Main Content
CSS Specificity
July 14, 2008 @ 11:26 am
A member of CSS-Discuss today was having a problem with a centered P tag not actually being centered in the browser. When I saw what the problem was I had a flashback of my early days with CSS and I understood how this person felt. The problem was with CSS Specificity, a concept I didn’t know about for a long time and my work suffered for it.
I understood the concept of the cascade and the relationship of external versus internal versus in-line styles, but I didn’t understand that there were forces acting on the CSS beyond all that. To me CSS was a kind of a roll of the dice in that sense. My CSS ended up very dense and I abused the !important rule. Shame on me.
I was reading a CSS book in Barnes and Noble a few years back and I came across the concept of specificity, and my life hasn’t been the same since. At least as far as CSS goes. So I think that specificity is an incredibly important yet infrequently spoken of concept.
Another CSS-Discuss subscriber posted information about the other users problem while I was caught up looking for a decent article about CSS specificity, so here you go: Read more about CSS specificity on onderhond.com
Leave a Reply
Topics:
Keywords:
Share:
Main Links
RSS Feeds
Recent Updates
- Overused Words: Bulletproof
- NewsWordy: Keyword Heavy CSS Driven Site
- Realtime Usage Statistics
- Animated GIF For CSS Sprites
- CSS Systems
- Reset, And Starting From Scratch
- Two Pseudo-elements You Can Use
- Semantic HTML Site Outline
- CSS Specificity
- Welcome To The New Blog
Topics
- About The Site (3)
- CSS Case Studies (1)
- CSS Globe (1)
- CSS Projects (1)
- CSS Thoughts (3)
- CSS Tips (3)
- CSS-Discuss (2)
- Overused Words (1)
- Site Usage (1)
Popular Keywords
- site statistics (0)
- about (1)
- css specificity (1)
- semantic HTML (1)
- naked CSS (1)
- pseudo-elements (1)
- css reset (1)
- starting over (1)
- CSS Systems (1)
- Natalie Downe (1)