Posts Tagged ‘CSS’

When CSS is !important

Friday, July 29th, 2011

If you are reading this, you know the gist of “!important” is to counter-act the normal application of CSS rules based on selector specificity. One way to look at this is that it’s a shortcut to make up for another rule’s selector that is too broad. Another way would be to describe it as getting things done and moving on. We can argue both ways depending on how much time/budget you have — but more importantly — how many places a given CSS file will be used.
(more…)

Pitfalls of styling the HTML element

Wednesday, April 13th, 2011

This was fun painful.

On the new ablesense.com website design, I had foolishly applied some styles to the <html> element — specifically my font stack for the website. The particular selection of fonts was very important in making this mistake obscure:

html { font-family: helvetica, arial, sans-serif; }

Browsers have default fonts

The fonts all looked fine in Firefox, Safari, Chrome, and Internet Explorer (Helvetica on Mac, and Arial on PC). This lines up with the CSS rule above, so it seemed like everything was fine — but it was not. (more…)