li元素编号在IE9中向右下方移动

时间:2015-03-23 13:41:45

标签: javascript jquery html internet-explorer

每次刷新页面内容时,li元素中的编号在IE9中向右下方移动,但对其他浏览器(firefox和chrome)工作正常。这是否需要IE特定的修复,还是我犯了错误?

使用Javascript:

if (jQuery("#" + divName).html() == "") {
    document.getElementById(divName).innerHTML = content;
}

CSS:

ol.rounded {
    counter-reset: my-counter;
    list-style: outside none none;
    margin: 0;
    padding: 0;
}
ol.rounded li {
    margin-bottom: 9px;
    padding-left: 25px;
    position: relative;
}
ol.rounded li:before {
    border: 10px solid #69b13b;
    border-radius: 50%;
    content: "";
    height: 0;
    left: 2px;
    position: absolute;
    top: -3px;
    width: 0;
    z-index: -1;
}
ol.rounded li:after {
    color: #FFFFFF;
    content: counter(my-counter, decimal);
    counter-increment: my-counter;
    font-size: 1.2em;
    font-weight: bold;
    left: 8px;
    position: absolute;
    top: 1px;
}

HTML:

<ol class="rounded">
    <li>
        <p>Abhishek Agarwal</p>
    </li>
</ol>

1 个答案:

答案 0 :(得分:0)

在每次刷新时,css(已经存在的页面)再次添加到头部。由于应用了多个css,li元素正在移动。