More CSS Optimization Techniques

A lot has been written about more efficient CSS (see further reading for some examples). Certainly, when you work with multiple people on larger sites, organizing your CSS in a logical, consistent manner becomes increasingly important.

In his post Squeaky Clean CSS Lokesh Dhakar provides some good tips and guidelines to follow.

Although the majority are not new to me, I did want to call out one useful technique I have not seen mentioned before for temporarily disabling style attributes.

Rather than commenting out the attribute, which can get pretty laborious after a while, simply place an "x" before the attribute name. For example:

#footer {
	border-top: 1px solid #e5e5e5;
	xborder-bottom: 1px solid #e5e5e5;

What a great idea! I can't believe I've never thought of doing that myself.

Further Reading

Posted on: February 27, 2006 | 1 Comment

Recent Entries in "CSS"

1 Comment Posted (Add Yours)

I done this for years, never really thought about it. I usually just as you say put an x in front of something or if its a value, I do it there, e.g.:

color: x#fff;

Nice one.


Subscribe to my RSS FeedSubscribe to my Web Design Blog RSS Feed


Proud member of 9rules network