Not a member? Why not join us or log in? (No more hassle filling in comments, less obtrusive ads and asides.)

One Year Ago | CSS Hacks

Posted by Andrew Faulkner on October 1st, 2006.

Andrew Faulkner is the admin at fadtastic. Andrew prides himself on standards-based, accessible web design in the city of Nottingham, UK. He believes in aesthetically pleasing accessible design and that 'standards compliant does not equal boring.'

http://fadtastic.net/

Andrew Faulkner has posted 208 articles.

RSS Feed for fadtastic.net RSS Feed for Andrew Faulkner

Full Profile →

Welcome to a first in a (hopefully) series of posts aiming to look back at trends and discuss them one year on. Cunning title, eh?!?! First up, CSS Hacking. (See original article on 01/10/05.)

Now in the article one year ago I was pleading against a majority of devlopers to think about CSS hacks for one moment. I was far from the only person to be warning about CSS hacks - I’m not claiming to be either for the record.

I still have the same feelings towards hacks. I think that the arguements used a year ago are still valid. Today, I think that most designer/developer types are of the same opinion as myself. I think the ‘exact-to-the-pixel’ thinking has dissolved on the whole and a concensus of ‘let the web be the web’ has arisen. With IE7 just around the corner, I feel that this could become a hot topic again.

Now I’m very keen to get your thoughts on CSS hacks in development today. Do you use them? Why? Do you think CSS hacks are essential or a hazard?

Let’s get debating.

Make A Comment

( 6 so far )

blockquote and a tags work here.

6 Responses to One Year Ago | CSS Hacks

Comments RSS Feed

Personally, I haven’t used them for quite some time now. The last time I used them was on a project built by someone else - for a corporate site that used a box model hack.

I don’t like them - and don’t plan on using them. I will find other ways to get the job done (that will be semantically correct and valid).

IF hacks HAVE to be used - at least manage them separately in order for easy fixes or upgrades when the browsers change.

Nate K
October 1st, 2006
#

IF hacks HAVE to be used - at least manage them separately in order for easy fixes or upgrades when the browsers change.

An excellent suggestion, Nate. Do you mean by using a seperate stylesheet?

Andrew Faulkner
October 1st, 2006
#

I find that i very rarely have to use css hacks.. what are people doing to have to use them? on the very odd occasion, when deadlines are tight I use conditional comments.

gareth
October 1st, 2006
#

You can use either IE conditional comments to serve certain CSS rules to target a specifc IE WIn version (IE5+). Though many designers and coders dont use them often unless to add the hasLayout
property (in short when an element has no dimensions set like width, height you get trouble as in CSS bugs).

IE and hacks

Star html Selector Bug for IE7-

Some examples
css hacks

eg * html #container{

}

Other hacks which could be used and are considered save. Though are rarely used.

Advice: avoid hacks at all costs that rely on parser bugs in browsers.

Some advanced CSS3 selectors which are not understood by ALL browsers can be used to target a specific browsers eg IE7 or Opera and filter out others. These hacks do NOT rely on parser bugs in browsers but are at the same time not really handy (not easy to remember) and maybe not future proof. Eventually other browsers could catch up and be able to read them too.

Examples

IE7
For Opera (CSS queries:
Eg @media all and (min-width: 0px)

Johan
October 1st, 2006
#

Hacks are sometimes needed. For example the * html hack can fix some slight issues with IE6. As long as you’re not importing completely different stylesheets I see no problem at all using smaller hacks to make your site look good across browsers. And really, for 2-3 additional/modified rules, I think that a * html hack (I think you can use +*html for IE7, correct me if I’m wrong though) is a better solution than using conditional comments, at least if you document the hacks you’re making with comments in your css-file.

Fredrik Wärnsberg
October 1st, 2006
#

For small IE problems I’ll use a hack, why not? But generally if there is list of problems, more than 1 or 2, I just work around it. An object of CSS is to add more simplicity and flexibility to our designs anyway, so working around small bugs isn’t tough.

Kabari
October 2nd, 2006
#

↑ Jump up to the comment form

Related In Some Way, Shape Or Form

The above post has obviously kept you amused. Why not discover similar material:

The posts Hacked off with CSS?CSS Hacks: Are They Cool or Not?Awesome HOT TIPS for YOUR WEBSITE in 2008Home for ChristmasOne Year On | Are ads ok yet?, are related to this post.

Or why not take time out to find out about the author of the post.