相关疑难解决方法(0)

了解CSS选择器

为什么下面的文字是红色的?

#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 css css-selectors

3
推荐指数
2
解决办法
1912
查看次数

为什么悬停时边界不会改变?

这是我的代码:

<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)

我很困惑:为什么悬停时边框颜色不会改变?

css border hover

1
推荐指数
1
解决办法
1067
查看次数

标签 统计

css ×2

border ×1

css-selectors ×1

hover ×1

html ×1