Home  >  Article  >  Web Front-end  >  Why does the css:list-style-type attribute often not work?

Why does the css:list-style-type attribute often not work?

黄舟
黄舟Original
2017-06-29 13:47:283312browse

If you set list-style-type:disc under IE6, a solid dot should appear, but it does not appear, such as the following code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>处理IE的列表BGU</title>
</head>
<style type="text/css">
ul{list-style:disc outside;width:350px;height:auto;}
ul li{width:350px;line-height:30px;}
</style>
</head>
<body>
<ul>
<li>酷站代码1</li>
<li>酷站代码2</li>
<li>酷站代码3</li>
<li>酷站代码4</li>
<li>酷站代码5</li>
</ul>
</body>
</html>

Reason: applied list-style-position: outside; caused by the attribute.

Left floating will make box modelHorizontal rehearsal one by one

The position of the list symbol is outside the box model

So the second list item symbol is covered by the first list item

In addition, applying the float:left; attribute will also cause the LI element to be abnormal.

Solution: Change list-style-position:outside; to list-style-position: inside; or remove the floating setting.

The above is the detailed content of Why does the css:list-style-type attribute often not work?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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