1
HTML是否可以使用:懸停在:first-child:之後?
<div>
<div></div>
</div>
CSS
div > :first-child:after {
background-color: orange;
color: #fff;
font-family: sans-serif;
font-size: 50px;
line-height: 50px;
text-align: center;
vertical-align: middle;
-webkit-font-smoothing: antialiased;
content: "hello world";
display: block;
font-size: 50px;
height: 160px;
line-height: 160px;
margin-top: 14px;
font-weight: normal;
}
div > :first-child:after:hover {
background-color: #44b800;
}
小提琴
基本上,所有我想要做的就是改變backgr徘徊在懸停的顏色,但它似乎並沒有工作。
你不能':hover'一個僞類。 ':之後'和':之前'不這樣工作。 – BenM
謝謝,我認爲是這樣,但在搜索答案時找不到任何東西。 – martincarlin87