gpt4 book ai didi

html - 选择具有 CSS 样式的第三个 div 的链接 (a)

转载 作者:太空宇宙 更新时间:2023-11-03 18:15:18 26 4
gpt4 key购买 nike

这是我的 html 代码:

<div class="one">
<p><a href="http://www.one.com">one</a></p>
</div>
<div class="two">
<p><a href="http://www.two.com">two</a></p>
</div>
<div class="three">
<p><a href="http://www.three.com">three</a></p>
</div>

我的问题是我想更改第三个 div 下的 third 标签的颜色。怎么办?

最佳答案

尝试使用这段代码:

body div+div+div a:hover
{
color:red;
}

或者简单地:

.three {

color:red;

}

演示:JSFIDDLE

关于html - 选择具有 CSS 样式的第三个 div 的链接 (a),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22930720/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com