Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS: IE 9 hack for margin-left? \9; has no effect

I have an element that currently has margin-left: -110px of course, this works with my design in all browsers except IE. With IE I need to make it margin-left: 10px

Normally, I would do my IE hacks by adding \9;, such as:

margin-left: 10px\9;

but it doesnt seem to work with margins. Does anyone know a way to acheive this? Many thanks!

<div id="nav">
  <ul>
    <li id="newstab">News</li>
    <li id="offerstab">Offers</li>
    <li id="specialsstab">Specials</li>
  </ul>
</div>

#nav {
    position:absolute;
    margin-left: -110px;
margin-left: 10px\9;
    margin-top: 160px;
    writing-mode:tb-rl;
    -webkit-transform:rotate(90deg);
    -moz-transform:rotate(90deg);
    -o-transform: rotate(90deg);
    white-space:nowrap;
}
like image 591
MeltingDog Avatar asked Nov 22 '25 01:11

MeltingDog


1 Answers

If you really need to, you can use an IE conditional block:

<link href="style.css" rel="stylesheet" />

<!--[if lt IE 10]>
    <style type="text/css">
        .thing {
            margin-left: 10px;
        }
    </style>
<![endif]-->
like image 88
Blender Avatar answered Nov 24 '25 22:11

Blender



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!