View Single Post
  #14 (permalink)  
Old 13-03-2008, 04:38 PM
PaulClark PaulClark is offline
Junior Member
 
Join Date: Mar 2008
Location: Kent, UK
Posts: 24
Default

Marcos (Marc?) - It's clear from your comment that you know how to make sites do what you want them to do. This solution:

Quote:
Originally Posted by Marcos117 View Post
if you want to add padding to a fixed width div you can simply place a div inside the one with the fixed width and add padding to that...
works. But - what's so great about making your HTML more complex solely to avoid a standards-friendly, well supported use of conditional comments to target specific directives for browsers that have ideosynchratic rendering?

I agree with not having multiple stylesheets - hard to maintain, and extra round trips to the server to load up, but using conditional comments and dependent selectors it is very easy to target IE versions, as follows:

In the HTML page:
HTML Code:
<body>

    <!--[if lte IE 6]>
        <div id="isIE_version_LTE6">
    <![endif]-->
    
    <!--[if IE 7]>
        <div id="isIE_version_7">
    <![endif]-->
    
        [PAGE CONTENT GOES HERE]
    
    <!--[if lte IE 7]>
        </div>
    <![endif]-->

</body>
In the CSS file:
HTML Code:
.someclass {
      [rules for someclass that IE renders incorrectly]
      }

#isIE_version_7 .someclass {
      [any additional rules required for IE7]
      }

#isIE_version_LTE6 .someclass {
      [any additional rules required for IE6]
      }
This approach minimises the need to mess around with your HTML, as you suggest doing to get around peculiarities of IE6 box model rendering, it is standards-friendly, and it doesn't rely on any hacks (a hack, to my mind, being exploiting one bug to get around another).
Reply With Quote