Home  >  Article  >  Web Front-end  >  How to clear li black spots in html

How to clear li black spots in html

青灯夜游
青灯夜游Original
2022-01-21 15:41:1115800browse

Methods to clear li black spots: 1. Use the list-style-type attribute, just add the "list-style-type:none;" style to the li element; 2. Use the list-style attribute , just add the "list-style:none;" style to the li element.

How to clear li black spots in html

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

Use ul and li tags in HTML to create a list:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
	</head>

	<body>
		<ul>
			<li>列表1</li>
			<li>列表2</li>
			<li>列表3</li>
		</ul>
	</body>

</html>

It is found that each item in the list has a small black dot by default:

How to clear li black spots in html

How to remove the black spots on the front of your chest?

Use the list-style-type attribute, which sets the type of list item tag. When the attribute value is "none", no tag is specified (that is, the tag is removed).

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<style type="text/css">
			ul li{
				list-style-type:none;
			}
		</style>
	</head>

	<body>
		<ul>
			<li>列表1</li>
			<li>列表2</li>
			<li>列表3</li>
		</ul>
	</body>

</html>

How to clear li black spots in html

You can also use the list-style shorthand attribute, which can set all list attributes in one statement.

ul li{
	list-style:none;
}

How to clear li black spots in html

Related recommendations: "html video tutorial"

The above is the detailed content of How to clear li black spots in html. 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