skip to content

The following is a list of articles tagged 'css'.

Order, Inheritance and Specificity in CSS

Posted by Stoo on 19th September 2009

Some quick notes on an easily misunderstood area of CSS. One thing to remember with CSS is the order statements appear in the stylesheet is important along with inheritance and specificity. So if you have the following: div { background-color: red; } ... snip ... div { background-color: green; } The green background will be applied. This is also true across multiple stylesheets. Rules from stylesheets linked later in the HTML will take precedence over stylesheets appearing earlier... more »

eLessar

Posted by Stoo on 19th June 2009

This week I discovered LESS, a Ruby gem allowing variables, mixins, nested rules and operations to be used in CSS. Variables are something I've wanted in CSS for years. Having to use search and replace tools to change a colour in a stylesheet is less than ideal – in fact it can be a nightmare if the colour is defined both as an RGB and hex value in different places. LESS allows you to parse a .less file containing LESS's syntax and save it as .css file. This is incredibly handy and is... more »