嗨,我是新來的CSS和我碰到這個文字下劃線動畫,我不明白它是如何工作的。如果我只是從這些代碼中拿出一些東西,它就會停止工作。提前致謝!有人可以請給我解釋這個CSS代碼
body {
background-color: black;
}
body a {
font-weight: 200;
font-size: 18px;
text-transform: uppercase;
text-decoration: none;
position: relative;
color: #fff;
}
body a:visited {
color: white;
}
body a:hover {
color: white;
}
body a:after {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 0%;
border-bottom: 2px solid #fff;
transition: 0.4s;
}
body a:hover:after {
width: 100%;
}
<body>
<a href="#">aaaaaaaaaaaaaaaaaaaaaaaaaaaaa</a>
</body>
我看,但什麼內容,位置,底部和左側什麼呢這些屬性與動畫做的,如果你把任何動畫甚至不會出現! –