当我试图在我的div id = four_sprint上应用CSS时,它不起作用
HTML代码:
<div class="select">
<div id="four_sprint">
<a href="four_sprint\index.php" style="text-decoration:none;">Show 4sprint</a>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
当我在HTML代码中的样式属性中应用CSS时,它可以正常工作
CSS代码:
#four_sprint{
cursor:pointer;
text-decoration:none;
color:black;
}
#four_sprint:hover{
color:orange;
}
Run Code Online (Sandbox Code Playgroud)
class ="select"有效但不是div id ="
看看你试图a标记的代码而不是div.所以使用:
#four_sprint a{
cursor:pointer;
text-decoration:none;
color:black;
}
#four_sprint a:hover{
color:orange;
}
Run Code Online (Sandbox Code Playgroud)