gpt4 book ai didi

css - 如何在链接中选择强标签并在悬停时更改颜色

转载 作者:太空宇宙 更新时间:2023-11-03 19:55:58 25 4
gpt4 key购买 nike

我敢肯定这真的很容易,但我不知道该怎么做,也没有在搜索时寻求帮助的词。

我有一个链接。链接内的某些文本位于 <strong> 内标签。 <strong>文字有颜色。悬停 <strong>文本没有改变颜色。如何让它改变颜色?

a:link {
color: rgb(25, 50, 50);
text-decoration: none;
}

a:visited {
color: rgb(25, 50, 50);
text-decoration: none;
}

a:hover {
color: rgb(100, 200, 200);
text-decoration: none;
}

a:active {
color: rgb(100, 200, 200);
text-decoration: none;
}

strong {
color: rgb(50, 100, 100);
}
    <li><a href="xyz.html"><img src="resources/logo.jpg"><div class="list_text"><strong>Heading</strong><br>Sub heading</div></a></li>

我希望悬停和事件时强标记内的文本与“子标题”文本 rgb(100,200,200) 颜色相同。

最佳答案

试试这个:

a:link { color:rgb(25,50,50); text-decoration:none; }
a:visited { color:rgb(25,50,50); text-decoration:none; }
a:hover strong { color:rgb(100,200,200); text-decoration:none; }
a:hover { color:rgb(100,200,200); text-decoration:none; }
a:active { color:rgb(100,200,200); text-decoration:none; }

strong { color:rgb(50,100,100); }
<a href="xyz.html"><strong>Heading</strong><br>Sub heading</a>

关于css - 如何在链接中选择强标签并在悬停时更改颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45573394/

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