gpt4 book ai didi

css - 如何更改仅 anchor 链接文本的颜色?

转载 作者:技术小花猫 更新时间:2023-10-29 10:25:03 28 4
gpt4 key购买 nike

我有这样的代码

<a href="#" title="some title">
<span>Do not change color of this text</span>
Want to only change this text color
</a>

我只想更改 anchor 标记文本的颜色,而不是 span 中文本的颜色。使用 CSS 而不是 jQuery。

最佳答案

创建样式以确保应用正确的颜色:

a {
color: #00f;
}
p, a span {
color: #000;
}

这会将普通文本 (p) 和跨度内部链接 (a span) 的颜色设置为黑色,而它会设置其余文本的颜色蓝色链接。

关于css - 如何更改仅 anchor 链接文本的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14831999/

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