开发者

Unwanted White space (poss padding) for wordpress site on Internet explorer 6

开发者 https://www.devze.com 2022-12-25 15:09 出处:网络
I have unwanted White space about the header image but this only visable from IE 7 back, IE 8 and other browsers display it perfectly.

I have unwanted White space about the header image but this only visable from IE 7 back, IE 8 and other browsers display it perfectly.

If anyone could point me in the right direction of how 开发者_开发技巧to correct this then that would be fab.

Thanks in advance

tim


IE uses a non-standard box model and accommodations can be made in html to handle IE based weirdness. Mostly this works because it is an HTML comment statement and thus is ignored by browsers other than IE, but IE catches it and knows to run the code. This works for IE versions less than 10.

I did this years ago, and a quick web search brought me some examples at http://www.quirksmode.org/css/condcom.html.

Basically you insert code such as

    <!--[if IE 6]>
    Special instructions for IE 6 here
    <![endif]-->

In the header this might be

    <!--[if IE 6]>
        <style type="text/css">
            img {margin-top: -10px;}
        </style>
    <![endif]-->

or to simply link in a css file only for IE 6 or earlier

    <!--[if lt IE 6]>
        <link rel="stylesheet" type="text/css" href="url to stylesheet for IE">
    <![endif]-->

In WordPress you can sneak this in using the editor in your admin pages. I use the Google Chrome browser and find the ID of the object I need to change with right-click / Inspect Element, then add appropriate code to make adjustments.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号