Browsers | CSS |
---|---|
IE6/IE7 | li{display:block; } |
IE8+ / Webkit / Firefox / Opera | li{display:list-item; } |
在這里,也基本上明了了。在除 IE6/7 以外的 A-Grade 瀏覽器中,就是一個"半內聯"的元素。提到 display:list-item;
,其實,即使現在所有的 A-Grade 瀏覽器都支持,用的人其實不多。為什么?其實就是沒什么用。在 Quirks Mode,PPK 是這樣說的:
display: list-item
means that the element is displayed as a list-item, which mainly means that it has a bullet in front of it (like an UL), except in IE 5 on Mac where it gets a number (like an OL). The numbers are buggy: all previous LI’s in the page count as one, so this example starts with number 5 (the screenshot was made before I inserted my compatibility-LI’s).Live example:display: blockdisplay: list-itemdisplay: list-item
Right。其實這個意義不大。但也算是解了自己的一個疑惑。分享出來,如果你也有這樣的疑惑,或許下次 Coding 的時候出現 Bug 或者其他疑問,估計也就能很快反應過來了。