Skip to Content

Setting up Junit ServiceTestUnit tests with Application references »
« Fixing performance issues in Ubuntu 12.10
submit to reddit

I have been coming back to HTML / CSS lately and I came across errors where my CSS would not be overridden. Then I found this very good article on CSS Precedence by Steven Bradley.

http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/

This article gives a thorough understanding of CSS Precedence, and is well considered looking at the comments …

The thing I got from it was that it is probably better to design your HTML with pseudo tags, as those styles will always give the lowest precedence. Then base styles can then be overridden more easily by giving class (0 0 1 0) or id (0 1 0 0) attributes to elements. This should give the greatest flexibility in correcting errors, and creating re-useable CSS.

Using !important should not be necessary in well designed CSS. They can be handy in a quick spot I guess – but long term they just make the CSS harder to edit.

W3 ref: http://www.w3.org/TR/CSS2/cascade.html

No comments yet!

You can be legendary and add one ...

All spam will be deleted - don't waste my time and yours. Fackbook profiles posted will be reported to FB as spam accounts


Allowed HTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*

By submitting a comment you grant Sentinel Web Technologies a perpetual license to reproduce your words and name/web site in attribution. Inappropriate and irrelevant comments will be removed at an admin’s discretion. Your email is used for verification purposes only, it will never be shared.

Setting up Junit ServiceTestUnit tests with Application references »
« Fixing performance issues in Ubuntu 12.10