<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link href="son.css" rel="stylesheet" />
</head>
<body>
<div id="first">
<p>nothing seek,nothing find</p>
<div id="second">
<p> all work and no play makes jack a dull boy</p>
<div id="third">
<p>ghvweuhbv</p>
<div id="fourth">
<p>hello</p>
</div>
</div>
</div>
</div>
<ul>
<li>Default <a href="#">link</a> color</li>
<li class="inherit">Inherit the <a href="#">link</a> color</li>
<li class="initial">Reset the <a href="#">link</a> color</li>
<li class="unset">Unset the <a href="#">link</a> color</li>
</ul>
</body>
</html>
css文件
body {
color: darkcyan;
}
#second{
/*border: 10px solid black;
background-clip: padding-box;*/
color: wheat;
/*background: pink;*/
}
/*旋转 鼠标划过hello,hello会绕着中心旋转*/
@keyframes rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
#fourth {
width: 50px;/*不设置此值,无法旋转?*/
color: red;
transform-origin: center;
}
#fourth:hover {
animation-name: rotate;
animation-duration: 0.6s;
animation-timing-function: linear;
animation-iteration-count: 5;
}
body {
color: green;
}
.inherit a {
color: inherit;
}
.initial a {
color: initial
}
.unset a {
color: unset;
}
请仔细观察文字与链接的颜色,体会继承