When working on moderately large web sites, it seems that the easiest part is writing CSS files straight-forward. However, if you always test your mark-up with your favourite browser you’ll probably have problems when you display that mark-up with other browsers.
You can always find some tips or tricks to solve some particular problems by searching on the web moreover you can spend lots of hours with trial and error.
Recently, i have found some valuable resources on how to write cross-browser compatible css files.
These browser-originated bugs are generally related to how a browser interprets your layout-oriented style properties.
The first thing we must do to deal with this bugs is understanding css basics right.
So, we must ask why CSS exists or why it resides “Cascade” word in its abbreviation.
“Cascade” is related to the “Inheritance” in this context.
This article below explains the inheritance in CSS with an explanatory example, however, i think that the universal selector-refusing idea can change according to the structure and scope of your web site.
The second rule explicitly overrides the inheritance of the containing paragraph’s font-size, that the author wished to apply. Since the universal selector will always match a parent’s child elements, it will override any inherited properties.
What if your project gets larger and detailed ?. Since you will probably have many nested elements to be styled, your code must be generic enough. So, how much generic style will be enough?
This article explains “Generalization in CSS” well.
So it turns out there’s a spectrum; you can move in either direction, in varying degrees. More dependencies make for a sticky and tangled mess of logic that creates extra work when you come back to modify your creation. More redundancies are verbose and bandwidth intensive, and create extra work for the initial creation process.
I tend to favour redundancy in theory, but I code in plenty of dependencies in practice. Redundancy is easier to understand, cheap enough when the CSS is being cached properly, but inconvenient to build. Dependencies are far easier to create when coding, but during browser testing and later modifications to the style they cause no end of headaches. And when I’m working on a CSS file that I know will have to be understood by someone else, there’s all the more reason to keep it simple.