Lyn Patterson wrote:
Good morning

I have the following hacks in a stylesheet which validates except for the hacks.

Hi Lyn,

If you're concerned about validating, I suggest you try conditional comments to feed IE/win a separate stylesheet. The conditional comment is only recognized by the IE/win parsing engine and not by Gecko's or the W3C validator's parser. As an extra bonus, you get all your hacks to sit together in one document, which improves maintainability.

Here's how you do this (ehm, how I do this ;-):

  <!-- Stylesheet for good ol' Netscape and IE 4.x generation. -->
  <link rel="stylesheet" type="text/css" href="/css/base.css" />

  <!-- Advanced presentation. -->
  <style type="text/css" media="screen">@import "/css/pretty.css";</style>

  <!-- Conditional comment for IE/Win only. -->
  <!--[if lt IE 7]><style type="text/css" media="screen">
  @import "/css/iehacks.css";
  </style><![endif]-->

The 'lt IE 7' makes sure that when MS releases a seventh incarnation of their browser (probably under Longhorn), your hacks don't break the layout in what is hoped to be a more standards compliant IE.

Jeroen

--
vizi fotografie & grafisch ontwerp - http://www.vizi.nl/

******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************



Reply via email to