<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>权重选择器优先级 背景</title>
</head>
<style>
body{
background-color: pink;
/*透明色*/
background-color: rgba(0,0,0,0.1); /*最后一个数字表示透明度,范围在0——1之间*/
background-image: url();
background-repeat:no-repeat; /*repeat/repeat-x/repeat-y*/
background-position: center top; /*top/bottom/right/left*/
background-position: 10px 10px; /*前面x 后面y 经常用到重要 */
background-position: 10px center;
background-attachment: fixed; /*fixed固定的 背景固定,滑轮滚动他不滚 scroll滚定的*/
/*连写*/
/*background: 背景颜色 背景图片地址 平铺 滚动; 位置*/
background: #000 url repeat scroll center top ; /*记住连写顺序不可以调换*/
/*边框*/
border: 1px solid red; /*dashed虚线 solid实线 dotted小虚线*/
}
table{
width: 200px;
height: 200px;
border: 1px solid pink;
border-collapse: collapse; /*合并相连边框*/
}
</style>
<body>
<!-- 权重 -->
<div>
1、优先级:color:red !import; > 行内样式 > id选择器 > 类选择器 > 标签选择器 > 通配符
</div>
<table>
<tr>
<td>111</td>
<td>111</td>
<td>111</td>
</tr>
<tr>
<td>222/td>
<td>222/td>
<td>222/td>
</tr>
<tr>
<td>333</td>
<td>333</td>
<td>333</td>
</tr>
</table>
</body>
</html>
权重选择器优先级 背景007
最新推荐文章于 2023-01-11 14:17:29 发布