這是一個適用于所有瀏覽器的示例。純CSS方法可在實(shí)際的瀏覽器中使用(即,除IE6 / 7之外的所有內(nèi)容),而代碼將覆蓋不受支持的代碼。它具有SSCCE的風(fēng)格html有序列表中有標(biāo)簽html有序列表中有標(biāo)簽,您無需更改即可復(fù)制'n'paste'n'run。
SO
$().ready(() {
if ($('ol:first').css('list-style-type') != 'none') { /* For IE6/7 only. */
$('ol ol').each((i, ol) {
ol = $(ol);
var = ol.('li').index() + 1;
ol.('li').each((i, li) {
li = $(li);
var = + '.' + (li.index() + 1);
li.('' + + '');
});
});
}
});
html>/**/body ol { /* Won't be by IE6/7. */
list-style-type: none;
-reset: ;
}
ol li: {
: () ". ";
-: ;
}
ol li ol {
list-style-type: none;
-reset: ;
}
ol li ol li: {
: () "." () " ";
-: ;
}
ol li span { /* For IE6/7. */
: 0 5px 0 -25px;
}
first third