Relearning CSS concepts
May 11, 2008, at 9:50 p.m.
In an effort to strengthen my working knowledge of CSS, I’ve been reading Eric Meyer’s Cascading Style Sheets: The Definitive Guide. It’s been enlightening, to say the least!
In my recent work, there are a few things that I wish I had known (or remembered, depending on the case):
- Using
list-style-image: url(some.gif);is (obviously) more efficient than usinglist-style-type: none; background: url(some.gif) no-repeat 0 50%; padding-left: 15px;. - If you need to tweak every radio button on a site, you’re better off avoiding hooks on each of their ID/class selectors and instead using an attribute selector:
input[type="radio"].
I might have needed to use the long versions anyway, because CSS is still a bit inconsistent across browsers—and I haven’t tested these. When I get the opportunity, I’ll let you know what the results are.