CSS - outline-width 属性



描述

outline-width 属性定义元素周围轮廓的宽度。

可能的值

  • length − 任何长度单位。此属性的长度单位不能为负数。
  • thin  − 比设置为中等的轮廓更薄的轮廓。
  • medium  − 比设置为细的轮廓更厚的轮廓,以及比设置为粗的轮廓更薄的轮廓的轮廓。
  • thick  − 比设置为中等的轮廓更粗的轮廓。

适用于

所有 HTML 元素。

DOM 语法


object.style.outlineWidth = "thin";

这是个例子 -


<html>
	 	<head>
	 	</head>
	 	<body>
	 	 	 <p style = "outline-width: 5px; outline-style: solid; 	padding: 10px">
	 	 	 	 This text is with 5px outline around it.
	 	 	 </p>
	 	 	 <p style = "outline-width: thin; outline-style: solid; padding: 10px">
	 	 	 	 	This text is with thin outline around it.
	 	 	 </p>
	 	 	 <p style = "outline-width: medium; outline-style: solid; 	padding: 10px">
	 	 	 	 	This text is with medium outline around it.
	 	 	 </p>
	 	 	 <p style = "outline-width: thick; outline-style: solid; padding: 10px">
	 	 	 	 	This text is with thick outline around it.
	 	 	 </p>

	 	</body>
</html>