Jitendra Vyas
Jitendra Vyas

Reputation: 152727

pseudo-elements :before absolute position issue in IE9 and Firefox, Chrome is OK

I'm using :before to make custom bullets (See example http://jsfiddle.net/cHqRd/1/) it's working fine in Chrome and Firefox but not in IE9 and Firefox

Check this example in Chrome and then IE9 and Firefox to see the difference http://jsfiddle.net/cHqRd/1/

Bullets are going down in IE9

HTML

<ul>
        <li> XSmall = UK 8</li>
         <li> Small = UK 10, Medium</li>
         <li> Medium = UK 12</li>
          <li> Large = UK 14</li>
          <li> small</li>
          <li> 179cm/ 5'11"</li>
 </ul>

CSS

 li {font-size:1.6em;
    list-style:none; 
    position:relative; 
    padding-bottom: 0.6%;
padding-top: 0.8%;}

 li:before {
  position: absolute;
  top: 0.1em;
margin: 27% 0 0 -3.6%;
    /* accommodate Camino */
    vertical-align: middle;
    display: inline-block;
    content: "";
    display:block;
    width:0.4em;
    height:0.4em;
    background: #6d6d6d;
    border-radius: 0.4em;
    box-shadow: inset 1px 1px 1px rgba(0, 0 ,0, 0.4);
}

enter image description here

Upvotes: 0

Views: 2271

Answers (1)

scessor
scessor

Reputation: 16115

The problem is the margin in the li:before definition, replace

top: 0.1em;
margin: 27% 0 0 -3.6%;

with

top: 0.5em;
left: -1.0em;

I can't test with IE9, in Firefox9 it works. Also see your updated example.

Upvotes: 2

Related Questions