Category: css
How Cascading Style Sheets are implemented in current browsers, what we can do with the language, and what to look forward to.
How Cascading Style Sheets are implemented in current browsers, what we can do with the language, and what to look forward to.
A post called Trash All IE Hacks! on the (rather lovely) Web Designer Wall blog has attracted a huge amount of comments recently with its call to stop pandering to those who have the audacity to still be using the previous version of Internet Explorer (approx. 80% of visitors on one site I manage), and to display the broken layout as punishment for anyone not au fait with modern browsers.
Just in case you missed it, I was being sarcastic there; to take that attitude would be like a TV station transmitting black & white signals to anyone who hasn’t yet bought a High Definition set.
From the many supportive comments, a few said things like 85% of my time is wasted coding for IE6!
or I spent two nights getting the layout to work in IE6!
; to that, I can only reply: either you are doing something wrong, or you are a bad coder – or both.
It’s not hard to get sites to display properly in IE6; sure, you’ll have to put in a little extra effort, but it shouldn’t be anything like 85% of your time, or 50%, or even 10%. All you need to do is follow these five simple steps:
Jeffrey Zeldman: King of Web Standards serves as an interesting profile of the standardista, as well as being a history of standards and a primer on their importance.
Recently I was chatting with Rapha Martins, and he mentioned a feature he’d like to see in CSS: a ‘default’ value for properties; that is, if you change the value of a property, a keyword that would change it back to the browser default rather than you having to specify that value again.
That has been proposed for CSS 3, with the ‘initial‘ value, and it’s been introduced into the latest preview of Firefox 3 (Gran Paradiso), with the browser-specific -moz- prefix. I’ve put together a quick couple of basic examples of how it will work (you will, obviously, need the latest preview to see them).
Reading this article listing 25 rounded corners techniques with CSS reminded me of perhaps the worst solution to the problem I ever read: rounded corners without images. 10 <div>‘s and a whacking great chunk of CSS… and the funniest part is the claim that this is the future of rounded corners
. What makes the laughter die a little is that three years later there’s still no pure CSS cross-browser solution without images.
Update: There’s a more practical look at this subject in a later post, Using SVG in background-image.
If adopted widely, the use of SVG in <img /> and background-image could be responsible for some big changes in website design.
Take a look at this example of images in SVG (you’ll need an SVG-capable browser), which displays four photos at random positions and sizes on the page. Images could be pulled at random from Flickr (or wherever) and rotated, resized, and placed in the page as a background. Combined with multiple images, you could create layers of effect, almost like collages… pretty revolutionary.
div { background-image:
url('layer1.svg') left top,
url('layer2.svg') left top,
url('layer3.svg') left top;
}
It looks like Opera will be first to implement this feature with their 9.5 release, previews of which should be available soon. No definitive word on whether they’ll implement multiple backgrounds, but I’m hopeful.
The W3C’s announcement that CSS2.1 has moved to ‘Candidate Recommendation’ status has been met with a muted response from the community – presumably because most people think they’re using it already.
As it’s inching closer to becoming a full recommendation, there are no new features introduced; a few, however, are in danger of being dropped when the CR process is over as they aren’t in common use. These include:
I’ve never used any of those features, and never seen the need for multiple id attributes, so from my point of view none of them will be a loss.
As the majority of CSS 2.1 rules have been in common use for a long time, I’d hope that this becomes a full recommendation as soon as possible, and that we can look forward to seeing CSS 3 become the sole focus of attention.