web前端入门笔记之css(5)
轮廓(outline)是绘制于元素周围的一条线,位于边框边缘的外围,可起到突出元素的作用。
CSS outline 属性规定元素轮廓的样式、颜色和宽度。
常用属性:
outline:在一个声明中设置所有的轮廓属性
outline-color:定义轮廓的颜色
outline-style:定义轮廓的样式
outline-width:定义轮廓的宽度
代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>轮廓</title>
<style type="text/css">
table{
/*
outline-width: 5px;
outline-color: blue;
outline:-style:dotted ;
与下面所表达的一致
*/
outline:5px dotted blue;
}
</style>
</head>
<body>
<table border="1px">
<tr height=50px>
<th>name</th>
<th>age</th>
</tr>
<tr>
<td>huaxiaoyou</td>
<td>12</td>
</tr>
<tr>
<td>achen</td>
<td>14</td>
</tr>
</table>
</body>
</html>
效果截图: