2012-01-09 53 views
0

我使用的是:之前進行自定義子彈(見例如http://jsfiddle.net/cHqRd/1/)它的正常工作在Chrome和Firefox,但不是在IE9和Firefox僞元素:之前在IE9和Firefox絕對位置的問題,Chrome是OK

檢查在Chrome這個例子中,然後IE9和Firefox看出差別http://jsfiddle.net/cHqRd/1/

子彈會在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

+1

在Firefox9中的行爲與IE9中的行爲相同。 – scessor 2012-01-09 08:30:46

+0

@scessor - 謝謝我更新了問題 – 2012-01-09 08:36:19

回答

2

的問題是在li:before定義margin,更換

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

top: 0.5em; 
left: -1.0em; 

我不能用IE9測試,在Firefox9中它工作。另請參閱您的updated example

+0

是您的解決方案也在IE9中工作。非常感謝 – 2012-01-09 08:39:08

+1

不客氣。 – scessor 2012-01-09 08:40:57