css中list-style-type為什麼總失效?

來源:互聯網
上載者:User
list-style屬性一般都設定為none 。需要加 "·" 或是別的符號 最好直接用鍵盤輸入 或用轉義符號

ul{list-style:none; margin:0; padding:0} ui li{line-height:Npx; } 一般是20px;

只要這樣設定, 基本都不會有問題。

一般CSS 裡都把Li{list-style:none;}


需要使用的時候,再單獨定義

li{background:url(…);}

(二)探討list-style-type 為什麼總失效?

關鍵是應用了float:left;屬性,還有 list-style-position: outside; 屬性造成的。原因如下:

1. 左浮動會使盒模型一個挨一個橫向排練
2. 列表符號的位置在盒模型之外
3. 所以第二個清單項目的符號被第一個清單項目蓋住

解決辦法:

[code="css"] li {   list-style-position: inside; } [/code]
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.