HTML Dog
跳至导航

列表标记的内外部

使用 list-style-position

HTML

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Lists marker position</title>
	<style>
		body {
			font: 1em arial, helvetica, sans-serif;
		}
	
		ul {
			border: 2px solid black;
		}
	
		li {
			border: 2px dotted #ccc;
			bfackground: #ccc;
		}
	
		.second {
			list-style-position: inside;
		}
	</style>
</head>
<body>
	<ul>
		<li>This</li>
		<li>That</li>
		<li class="second">The other</li>
	</ul>

	<!-- Link back to HTML Dog: -->
	<p><a href="https://htmldog.cn/examples/"><img src="https://htmldog.cn/badge1.gif" alt="HTML Dog"></a></p>
</body>
</html>

输出

查看原文