Why does list-style-type always fail in css?

黄舟
Release: 2017-06-29 13:36:10
Original
2853 people have browsed it

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;
Copy after login

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(…);}
Copy after login

(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]
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template