Home >Web Front-end >CSS Tutorial >Why does list-style-type always fail in css?
list-styleAttributes are generally set to none. If you need to add "·" or other symbols, it is best to input it directly with the keyboard or use the escape symbol
ul{list-style:none; margin:0; padding:0} ui li{line-height:Npx; } 一般是20px;
As long as you set it like this, there will basically be no problem.
Generally, Li{list-style:none;}
is defined separately in CSS when it needs to be used
li{background:url(…);}
(2) Discuss why list-style-type always fails?
The key is the application of float:left; attribute, and list-style-position: outside; attribute. The reasons are as follows:
1. Left floating will make the box modelrehearse horizontally one by one
2. The position of the list symbol is outside the box model
3. So the second The symbols of list items are covered by the first list item
Solution:
[code="css"] li { list-style-position: inside; } [/code]
The above is the detailed content of Why does list-style-type always fail in css?. For more information, please follow other related articles on the PHP Chinese website!