Whilst I’ve become aware that YUI and others prefer to exploit CSS parser bugs to target specific versions of IE I prefer the use of IE conditional comments. I recognise the former offers the maintenance benefit of having IE declarations within the same rule as standard declarations but it still feels too hacky to me.
I also like the idea, should the day come, that IE support might be dropped; having separate stylesheets would make this satisfyingly easy and wouldn’t result in a handful of redundant declarations interspersed with standard declarations.
With this being said I wanted to sha...
Continue reading
It's all too easy too find CSS builds that don’t adapt to changing font sizes or accommodate varying lengths of textual content. As an example of what I mean try increasing your font size on any of these sites:
As you can see the content quickly spills out of the design. This is a bad practice for two reasons:
- Accessibility - users who are hard of sight and browse the web at larger font sizes are going to have trouble reading the content as it breaks the design.
- Adaptability - even if a build is deve...
Continue reading
IE8 doesn't support the :last-child pseudo selector which is fine -- we’re going to be faffing about with last-child classes in our mark-up for a number of years yet. I’ve just discovered, however, that IE8 fails to honour a supported selector if it is grouped with a second selector containing :last-child. Here’s an example.
Take this HTML:
<ul>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
<li>item 4</li>
<li class="last-child">item 5</li>
</ul>
And this CSS:
li {
background:red;
}
li:last-child, li.last-child {
background:blue;
}
You’d expect all list items ...
Continue reading