2012-06-13 132 views
0

我遇到了与我的mandatoryIndi​​cator类星号有关的问题,以及它们在IE7中的外观。出于某种原因,星号几乎出现在表格上方的City:标签上,但在Firefox和IE 8及更高版本中看起来很好。我也包含了HTML的受影响部分。任何帮助将不胜感激。IE 7 CSS float问题

.mandatoryIndicator { 
    margin: 0 0 0 -.75em; 
    padding: 0 4px 0 2px; 
    color: #cc0000; 
    font-weight: bold; 
    float: left; 
    position: relative; 
} 

<td class="alignTop width35"> 
    <label for="mailingCityEntry"> 
     <span class="mandatoryIndicator" title="Mandatory">*</span> 
     City: 
    </label> 
</td> 
+0

你可以做一个http://jsfiddle.net/或http://jsbin.com/演示? – thirtydot

回答

0

尽量不要在CSS中使用negative valuemargin。这总是会在IE7中产生样式问题。无论如何,你不应该使用位置:内联元素的相对值(span)。它仅用于块级元素i.e. div以包含其他元素。