我的問題是:after
元素是在元素中的文本。這裏有一個例子:css3之後是一個元素中的文本
我想:after
是文字的下方。
我該如何解決這個問題?
body {
text-align: center;
}
a {
display: inline-block;
text-decoration: none;
padding: 10px;
background: #222;
color: #f3f3f3;
font-size: 2em;
margin: 20px auto;
position: relative;
}
a:after {
content: "";
width: 100%;
height: 50%;
background: #00A3A3;
position: absolute;
left: 0;
top: 0;
}
<a href="#">Home page</a>
你太聰明瞭:| –