Css3 样式
2019年11月30日
作者:佚名
Css3 在css 的基础上 ,增加了一些样式,为了满足移动端的需求,弹性盒代替浮动,自适应…
Css2.0 中的所有样式 在css3 中都可用
Css3中的选择器:融合了 jquery中的选择:
Rgb :
R red 0—255
G green 0---255
B blue 0—255
调色板中颜色,都是有 r g b 数值不同 配成的相应的颜色
Rgba alpha 透明度
案列:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<link href="css/index.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div>
<div>aaa</div>
<p>ccccc</p>
</div>
<p>dddd</p>
<div class="demo">eeee</div>
<div class="demo1">eeee</div>
<div class="demo2">eeee</div>
<h1>aaa</h1>
</body>
</html>
Css:
@charset "utf-8";
/* CSS Document */
p:first-of-type /* 同一个父元素下的 首个该元素*/
{
background:#ff0000;
}
p:nth-of-type(2){
background:#00ff00;
}
:root
{
background:#ececec;
}