Recommended Free Tools
CSS specificity is a tie-breaker in the cascade, not a universal strength score. Before comparing selectors, the browser has already considered whether rules apply and their origin, importance, and cascade layer. When declarations remain tied on those earlier criteria, compare selector weight in three columns: IDs, class-like selectors, and types. Understanding that order—and checking the browser’s winning rule before escalating a selector—solves most specificity problems without a pile of overrides.
Where specificity fits in the cascade
The browser resolves competing declarations in stages. It first considers whether a rule is relevant, then compares origin and importance, layer precedence, specificity, scoping proximity, and finally source order. Specificity matters only among declarations still in contention after the earlier criteria. That is why a selector that looks more specific can lose to a less specific one.
For a practical explanation of this sequence, see MDN’s introduction to the CSS cascade. The full ordering has additional details, but this sequence is enough to guide most debugging.
How to calculate specificity
Write specificity as three columns, often shown as ID-CLASS-TYPE. Compare the columns from left to right. The first unequal column decides the result; do not add the values into a total or treat them as decimal numbers.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
- ID: ID selectors such as
#app. - Class: classes such as
.notice, attribute selectors such as[type="warning"], and pseudo-classes such as:hover. - Type: element selectors such as
pand pseudo-elements such as::before.
Combinators—including descendant whitespace, >, +, and ~—and the universal selector * add no weight. They describe relationships or match elements; they do not increase specificity.
Worked examples
| Selector | Specificity | Why |
|---|---|---|
#app .notice[type="warning"] p::before |
1-2-2 |
One ID; one class and one attribute; one element and one pseudo-element. |
.card p |
0-1-1 |
One class and one element. |
#card p |
1-0-1 |
One ID and one element. It wins the specificity comparison against .card p if the declarations are otherwise at the same cascade position. |
html body main input |
0-0-4 |
Four element selectors. |
:root input |
0-1-1 |
:root is a pseudo-class and counts in the class column; input counts in the type column. It outranks html body main input because the class column is compared first. |
For a comma-separated selector list, the matching branch determines specificity for the element. The branches do not add together. For example, if an element matches .notice in .notice, #app p, that branch’s weight applies to the declaration for that element.
MDN’s specificity guide and the Selectors Level 4 specification document the counting rules.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Modern pseudo-classes that change the calculation
:is(), :not(), and :has() do not each contribute a fixed pseudo-class weight. Instead, each takes the weight of its most-specific selector argument. This can make a selector unexpectedly heavy even when the element matches a less-specific argument.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
For example, :is(.notice, #app) p has specificity 1-0-1: the most-specific argument, #app, supplies the ID column, and p supplies the type column. Avoid placing an ID in one of these argument lists unless you intend that higher weight.
:where() is different: it always has zero specificity, including the specificity of its arguments. Thus :where(#app) p is 0-0-1. Use it to scope defaults that should remain easy to override. These rules are covered in the Selectors Level 4 specification.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Why a less-specific rule can win
Origin and importance are considered first
Specificity cannot override an earlier cascade criterion. A declaration can lose because of its origin or importance before the browser reaches selector weight. Inline styles also have special precedence relative to stylesheet rules in the same importance and origin context; they are not simply another ID in the three-column calculation. Do not assume a normal stylesheet selector can beat a normal inline style by accumulating classes or IDs.
!important changes cascade priority; it is not a specificity fix. Adding it solely to overpower a selector mismatch often creates a harder conflict later.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsLayers can outweigh selector weight
Cascade layers let teams define stylesheet precedence without inflating selectors. For normal declarations in the same origin, a later layer beats an earlier layer, and normal declarations outside explicit layers beat normal declarations inside them. For important declarations, layer order reverses. A layer changes where declarations compete in the cascade; it does not change a selector’s specificity.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
For example, you can define a deliberate order for reset styles, third-party styles, components, and overrides, then place declarations in the appropriate layer instead of appending ancestors or IDs. MDN’s cascade layers guide explains practical ordering and debugging. The CSS Cascading and Inheritance Level 5 specification describes layers as a way to order styling concerns without changing selectors or relying on appearance order across layers.
Scope proximity and source order resolve later ties
If declarations tie on the preceding criteria, the browser considers scoping proximity and then source order. When selectors have equal specificity, a rule closer to the relevant scope can win; if those criteria also tie, the later declaration in source order wins.
A reliable workflow for fixing a conflict
- Inspect the element in browser developer tools. Open the element inspector and find the property in the Styles or Rules pane. Identify the applied declaration, crossed-out declarations, selector matches, and stylesheet locations.
- Confirm the rules are actually competing. Check that both target the same element and property, that media queries or other conditions apply, and that the expected stylesheet loaded.
- Compare earlier cascade criteria. Check origin, importance, and layer before calculating specificity. A crossed-out rule can have higher specificity yet lose because it is in a lower-precedence layer or has lower importance.
- Calculate the remaining selectors. Tally ID, class-like, and type components separately; inspect arguments to
:is(),:not(), and:has()for hidden weight. - Check later tie-breakers. If the weights match, inspect
@scopeproximity and then source order. - Choose the smallest maintainable correction. Prefer fixing layer organization or rule placement, or using a reusable class. Keep selectors straightforward; use
:where()for low-weight scoping when appropriate. Reserve!importantfor a deliberate need and document it for maintainers.
How to avoid recurring specificity problems
- Agree on a layer order for resets, third-party styles, components, themes, and overrides rather than letting incidental file order decide.
- Prefer reusable classes over selector escalation. Long ancestor chains and repeated IDs make later overrides increasingly difficult.
- Use
:where()for scopes intended to be easy to override. It scopes matching without adding selector weight. - Keep exceptional priority explicit. If an important declaration is necessary, document why it exists and what should replace it.
- Debug the cascade before editing. A quick check of the winning rule can prevent unnecessary specificity increases.
Or skip the browser setup
If your CSS debugging workflow also needs page captures, ScreenshotNeo is a website screenshot API and MCP server. One GET request returns an image or PDF, with options for full-page capture, viewport and device settings, waiting for page conditions, custom CSS or JavaScript, and more. Its clean-shot workflow accepts consent banners and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status. AI agents can use its MCP server tools: take_screenshot, get_page_info, and capture_pdf.
Example cURL request (replace the target URL as needed):
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo documentation for API parameters and setup. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Sign up free for 1,000 screenshots a month, with no card required.
Frequently Asked Questions
Does adding more parent elements make a CSS selector more specific?
No. Combinators do not add weight, and adding element names only increases the type column, which cannot outweigh a nonzero class or ID column.
Do comma-separated selectors combine their specificity?
No. For an element matched by a branch, that matching selector determines the declaration’s specificity; the branches are not added together.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

