Random (but not really)

Tuesday, May 6, 2008

Conditional Comments

HA!

I just discovered something that makes my life much easier. Microsoft added “Conditional Comments” into their browsers, so I can do all the cool CSS stuff I want, and then just have a boring page that doesn’t use the cool stuff that IE (and only IE) doesn’t support.

Simply create a style sheet only for IE, that doesn’t have all the neat code supported by every other browser out there, then the following code (where IEsucks.css is the name of your less cool style sheet) to the head section of your HTML page:

<!–[if IE]>
<link rel=”stylesheet” href=”IEsucks.css” />
<![endif]–>

That’s it! I can now use fixed positioning with impunity! MUAHAHAHA!

(See here for what I can do if I get to ignore IE not following the rules.)

ADDENDUM the First:
Get comment code doesn’t show up when you post it. Funny that.

(sigh)

Code is now fixed and visible.

Powered by WordPress

This is text at the bottom of the page.

Discover more from Random (but not really)

Subscribe now to keep reading and get access to the full archive.

Continue reading