tags:

views:

40

answers:

1

for big website's CSS what we should use IE condition sheets ( IE6, IE7, IE8 if needed) or CSS hacks in multiple people environment?

and CSS will be handled by multiple people.

I'm thinking to use hacks with proper comments because there are chanceh to forgot for other to make any changes in both css.

For example : #ab { width:200px} in main css and #ab { width:210px} in IE css.

Need your view on this. Thanks in advance.

+1  A: 

Never use CSS hacks as they are not guaranteed to work when new browser versions come out.

The best way is to use IE conditional comments to load IE specific stylesheets. This method keeps your CSS leaner too for all the other browsers.

Regarding your width example above: you can probably get around this by using relative positioning to add padding instead of the padding rule.

Here is a cross-browser example of 5px padding in a 210px wide div:

HTML

<div id="wrap">
   <div id="content">
      <!-- content -->
   </div>
</div>

CSS

#wrap {
   width:210px;
}
#content {
   width:200px;
   position:relative;
   left:5px;
}
Matthew James Taylor
yes but i think now any new version would not come for IE 6 and 7
metal-gear-solid
@metal-gear-solid: Many intranet for large globals still use IE6
gbn
@gbn - yes but i think now microsoft will not release any patch for IE6 and 7 , he is focusing in IE8 and 9
metal-gear-solid
@Matthew James Taylor - "Never use CSS hacks as they are not guaranteed to work when new browser versions come out." but we use css hacks for older browsers not newer browsers.
metal-gear-solid