Jump to content

Archived

This topic is now archived and is closed to further replies.

Ninjakreborn

General css advice, dealing with hacks, and other things.

Recommended Posts

I know that browser sniffing is frowned upon, I know hacks are bad to use, but when does it come to the point where you need hacks, and you don't need hacks?

Share this post


Link to post
Share on other sites
when you create simple semantic markup.

If you use the strict doctype it forces ie render in a compliant manner  (or so far as I have experienced). Even then I have done a number of transtional sites and set out to negate the need for css hacks.

If you want to rid your self of the css hacks but waht you want to do is 'impossible' just by forming good semantic html you can use the html hack!

this involves you placing a div around every element on your page that has padding and border with another div that has no margin padding or border - just a container.

It is extra html but if you can live with it I don't care. ;)

Share this post


Link to post
Share on other sites
[quote]If you use the strict doctype it forces ie render in a compliant manner  (or so far as I have experienced).[/quote]

Only in IE 6.0/7.0 and ONLY specifically for the "box-model" hack alone. And more <div>s are not the answer. That's commonly known as "divitus" to the css guru community.

It is so much more, in so many ways. IE 6.0 has quite a few buggy ways (other than the box model) of mangling proper standards compliant css. Most of the issues are with floats, and flexible layouts (fixed layouts and fonts - using set px sizing -  fare slightly better in IE).

Here is a great site that explains ALL of them from the author of the "holly hack" . These CSS bugs are all found only in Internet Explorer, versions 5 and higher (and they have a section on IE 6.0 bugs, as well):

[url=http://www.positioniseverything.net/explorer.html]http://www.positioniseverything.net/explorer.html[/url]

But! The best way to check if you need a hack or not is to view your site on the various IE broswer versions. At my office we have a Mac with IE 5.23 for Mac. One PC with 5.1x and one with 5.5.

And of course our workstations/laptops all have 6.0. You only need to worry about IE. Nearly all of the other modern browsers are standards compliant. Chances of a user with an old Opera or Netscape are slim since most of the people who use them know what they are doing and actually use the most current version - if not they fall back on their computers IE. And Mac's Safari, even the older versions, handle standards just fine.

Incidentally, I would be happy to check anybody's finished VALIDATED standards compliant websites (that also first work as expected in IE 6.0!) and render a screenshot for you. Just send me an IM request.

Dave

Share this post


Link to post
Share on other sites
Thanks, I will do that, when I rebuild my site, and other's I will start messaging you to get your opinion in other browsers.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.