Urgent.News

What's breaking now, across hundreds of outlets.

Tech

CSS Specificity Explained: Why Your Style Is Not Applying

You wrote the rule, DevTools shows it, and it is crossed out. Specificity is almost always why. How it is scored Think of three columns: IDs, classes/attributes/pseudo-classes, elements. #nav .item a is (1,1,1). Higher column wins; ties go to the later rule. Things people get wrong !important and inline styles sit outside the normal scoring :where() has zero specificity; :is() takes its most…

The article explains the concept of CSS specificity and why your style may not be applying as expected. It introduces the scoring system, which involves three columns: IDs, classes/attributes/pseudo-classes, and elements. The higher the score in a column, the greater the specificity, and if there's a tie, the later rule takes precedence.

The article also highlights common mistakes, such as using !important or inline styles, which do not affect specificity, and using universal selectors, which add no specificity. It concludes by offering practical rules for styling, such as using single-class selectors and avoiding IDs, and suggests using a CSS specificity calculator to check the score of a selector.

Brief written by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Audit EPUB Cover Metadata With a Small Python Script

When an EPUB shows its cover in Apple Books or Calibre but arrives on a Kindle as a grey tile, the image is usually fine.

  • EPUB cover metadata can be audited with a small Python script
  • Script reads container.xml, finds OPF package file
  • Ensures all metadata declarations point to correct cover image

Subscription Entitlements: Read Plan Tier Evidence Through 3 Media Billing Checks

A media access review needs a signer who can explain which subscription authorized an export and which account should receive its usage. A plan name alone cannot carry that explanation.

  • Reviewer needs specific evidence: requesting account, entitlement revision, billing owner
  • Implement programmatic decision path in Node.js SaaS application for media exports
  • Export carries operation identifier into usage accounting for traceability

Ransomware compromised server and backups of accounting office in 2018

Invasion during the weekend An accounting office was hit by a ransomware attack in 2018. On Monday, employees found the files encrypted and a demand for R$ 20 thousand in Bitcoin to regain access.

  • Accounting office in Brazil hit by ransomware attack in 2018
  • Hackers exploited exposed DVR port to gain network access
  • Data recovered for 60%-70% after partial recovery

Securing a Fresh Linux VPS: SSH Keys, UFW, and Fail2ban in 20 Minutes

Introduction to Securing Your Linux VPS Congratulations on your new Linux VPS! Whether you're hosting a website, setting up a development environment, or experimenting with server management, securing…

  • Enable SSH key authentication for enhanced security
  • Configure UFW firewall to block unauthorized access
  • Implement Fail2ban to prevent brute-force attacks

Why Your Headless Browser Can't Scrape Everything

Originally published on my blog — read it there with the full context, code and updates . I hit the same wall a few weeks apart, on two different second-hand marketplaces, and the contrast taught me…

  • Headless browsers scrape Carousell's freshly-listed products easily.
  • Goofish blocks headless browsers, requiring authentication and anti-bot checks.
  • Data source determines scraping approach: server-rendered vs asynchronous requests.

More from Sunday 22 November →