为什么下面的文字是红色的?
#stories li a {color:red}
.default li.expand a {color:green}
li.expand a {color:blue}
Run Code Online (Sandbox Code Playgroud)
<ul id="stories" class="default">
<li>this is the end</li>
<li class="expand">this is the end</li>
Run Code Online (Sandbox Code Playgroud)
只有当我把#stories放在其他文件上时,文本才会改变.#是否有更多的优势,即使它进一步上升到css?!
这是我的代码:
<html>
<head>
<style type="text/css">
p:hover{border:2px solid red;}
</style>
</head>
<body>
<p style="border:2px solid green;">This is a paragraph.</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我很困惑:为什么悬停时边框颜色不会改变?