gpt4 book ai didi

css - 更改所有链接状态相同颜色的 css

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

我有一个名为“tomato”的跨类。

我的 CSS 是:

.tomato a:link {color:#FF0000;}      /* unvisited link */
.tomato a:visited {color:#FF0000;} /* visited link */
.tomato a:hover {color:#FF0000;} /* mouse over link */
.tomato a:active {color:#FF0000;} /* selected link */

有没有办法将所有这些组合成更小的代码? (我希望链接在所有状态下都是红色的)

最佳答案

这是最短的,我认为你不能比它更短:

.tomato a:link, .tomato a:visited, .tomato a:hover, .tomato a:active { color:#FF0000; }

.tomato { a:link, a:visited, a:hover, a:active { color:#FF00000; } }

希望这对您有所帮助。

关于css - 更改所有链接状态相同颜色的 css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8855413/

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