这个例子比较明显
<style>
:target
{
background-color: #e5eecc;
}
</style>
</head>
<body>
<p><a href="#news1">跳转至内容 1</a></p>
<p><a href="#news2">跳转至内容 2</a></p>
<p>请点击上面的链接,:target 选择器会突出显示当前活动的 HTML 锚。</p>
<p id="news1"><b>内容 1...</b></p>
<p id="news2"><b>内容 2...</b></p>
<style>
:target
{
background-color: #e5eecc;
}
</style>
</head>
<body>
<p><a href="#news1">跳转至内容 1</a></p>
<p><a href="#news2">跳转至内容 2</a></p>
<p>请点击上面的链接,:target 选择器会突出显示当前活动的 HTML 锚。</p>
<p id="news1"><b>内容 1...</b></p>
<p id="news2"><b>内容 2...</b></p>
2018-05-03
:root优先级高
:root{
background:green;
}
html{
background:red;
}
:root{
background:green;
}
html{
background:red;
}
2018-05-03
div {
width: 300px;
height: 200px;
background: red;
color:#fff;
margin: 20px auto;
animation: changecolor 5s linear infinite .2s ;
}
width: 300px;
height: 200px;
background: red;
color:#fff;
margin: 20px auto;
animation: changecolor 5s linear infinite .2s ;
}
2018-05-02
这样的效果会好一点
.boxshadow-outset{
margin:18% auto;
width:100px;
height:100px;
box-shadow:4px 4px 6px 1px #666,
10px 10px 50px 10px #888 inset;
border-radius:50px;
transition:transform 0.5s;
}
.boxshadow-outset:hover {
transform: scale(1.4);
}
.boxshadow-outset{
margin:18% auto;
width:100px;
height:100px;
box-shadow:4px 4px 6px 1px #666,
10px 10px 50px 10px #888 inset;
border-radius:50px;
transition:transform 0.5s;
}
.boxshadow-outset:hover {
transform: scale(1.4);
}
2018-05-01
伪元素的优先级 大于非伪元素的优先级, :root > *>body 的优先级 :root(结构伪类选择器)=HTML
???:root是伪类选择器优先级大于body元素选择器没问题,但通配符选择器*的优先级应该是低于元素选择器body的吧,那么多的赞,难道我学了假的CSS?
???:root是伪类选择器优先级大于body元素选择器没问题,但通配符选择器*的优先级应该是低于元素选择器body的吧,那么多的赞,难道我学了假的CSS?
2018-05-01