html - Override CSS Classes Infinitely -


this more of theoretical question.

is stack of overrides css ad-infinitum? instance, there css override every override?

lets have written this:

<!doctype html> <html lang="en">   <head>     <meta charset="utf-8">     <title>title</title>     <style>       .a {         color: red;       }       /* override again */       div.a {         color: blue;       }       /* again! */       body div.a {         color: yellow;       }       /* again!! :) */       html body div.a {         color: yellow;       }       /* , again!! */       html body div.a {         color: pink !important;       }     </style>   </head>   <body>     <div class="a">a</div>   </body> </html> 

is !important combined html body div.a absolute highest level override div.a?
must there exist higher override?

in theory can repeat rule increase specificity.

.foo.foo.foo { } 

in practise, browsers treat selector having many components , ignore it.

(there style attribute, more specific selector)


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo