Skip to main content

All Questions

0 votes
0 answers
28 views

Can we put inherited style as the 0 precedence order in this complete cascading order table?

Would it be correct to put *inherited style" as the 0 (lowest) precedence order row in this Complete Cascading Order table? Or would it be more correct to add a fourth column to the ID-CLASS-TYPE ...
joseville's user avatar
  • 973
1 vote
3 answers
928 views

Background color overridden even after reversing the order of CSS layers

I want to use the new CSS cascade layers feature supported by latest versions of Chrome, Firefox, Safari, and Edge (see the support table). I'm importing a stylesheet from highlight.js. It has a class ...
Mahozad's user avatar
  • 25.1k
2 votes
2 answers
252 views

CSS cascading precedence of origin and importance

According to the specs, the precedence of declaration origins is as follows (Top wins): Transition declarations [css-transitions-1] Important user agent declarations Important user ...
kapantzak's user avatar
  • 11.8k
1 vote
2 answers
110 views

Does CSS ever care about DOM "closeness" relationships?

Given the following code: div, span { padding: 10px; display: block; } .light-background { background-color: #cacaca; } .dark-background { background-color: #333; } .dark-background ...
mindfullsilence's user avatar
1 vote
1 answer
1k views

media-query specificity - why is the largest style used when using max-width media queries?

I have the following (simplified) example code: ( jsbin: http://jsbin.com/cisahilido/1/edit?html,css,output ) SCSS: .container { background: none; } @media screen and (max-width: 480px) { ....
tdc's user avatar
  • 5,464
3 votes
2 answers
278 views

What determines the order CSS is "specified" between two elements when loaded from different files?

I'm helping to debug a CSS issue where two identical selectors are loading in a different order between two identically configured servers. One rule gets loaded from a stylesheet defined in the page ...
Matt V.'s user avatar
  • 9,819
4 votes
6 answers
340 views

CSS precedence logic

In this example: http://jsfiddle.net/Ja29K/ <style> /* Default links */ a { color: #0F0; /* Green */ } /* Header links */ #header a { color: #F00; /* Red */ } /* Login ...
André Abreu's user avatar
0 votes
1 answer
114 views

Changing Specificity

<html> <head> <style type="text/css"> #sidebar p { font-family: Verdana; font-size: .9em; } #sidebar .intro { font-family: Georgia; ...
swati16's user avatar
  • 371
3 votes
1 answer
516 views

CSS specificity / priority based on order in style sheet?

I had a brief look at the CSS3 Selectors spec but couldn't find anything how to get round this problem. Additionally, I wasn't expecting the result from this to change when you move the CSS ...
AJP's user avatar
  • 28.7k