// 让一个人的头像编程圆的
.avatar {
border-radius: 100%;
width: 50px;
height: 50px;
}
// 一个碰上去,点击会变颜色的 button
button {
background: rgba(0,0,0,0.5);
transition: background 0.3s linear, color 0.3s ease-in-out;
}
button:hover {
background: rgba(0,0,0,0.7);
}
button:active {
background: #000;
color: blue;
}
// 一个会转 50° 的方格
.rotate {
transform: rotate(50deg);
}
.rotate.rotating {
animation: rotate 10s linear infinite;
}
@keyframes rotate {
from {
transform: rotate(0);
}
to {
transform: rotate(360deg);
}
}