gpt4 book ai didi

html - 如何将 css 样式应用于标签?

转载 作者:太空宇宙 更新时间:2023-11-04 13:17:02 26 4
gpt4 key购买 nike

我的 html 里面有一个标签 <i> .我已经对所有 <a> 应用了一些样式我的 HTML 中的标签。但我想分开任何 <a> <i> 中的标签标签。我该怎么做?

a.aCategory:link {
color: #000000;
font-family: Arial;
font-size: 12px;
font-weight: bold;
}

a.aCategory:visited {
color: #999999;
text-decoration: none;
font-family: Arial;
font-size: 12px;
font-weight: bold;
}

a.aCategory:active {
color: #000000;
text-decoration: none;
font-family: Arial;
font-size: 12px;
font-weight: bold;
}

a.aCategory:hover {
color: #999999;
text-decoration: none;
font-family: Arial;
font-size: 12px;
font-weight: bold;
}

a.aSubCategory:link {
color: #000000;
text-decoration: none;
font-family: Arial;
font-size: 11px;
font-weight: bold;
}

a.aSubCategory:visited {
color: #999999;
text-decoration: none;
font-family: Arial;
font-size: 11px;
font-weight: bold;
}

a.aSubCategory:active {
color: #000000;
text-decoration: none;
font-family: Arial;
font-size: 11px;
font-weight: bold;
}

a.aSubCategory:hover {
color: #999999;
text-decoration: none;
font-family: Arial;
font-size: 11px;
font-weight: bold;
}

a:link {
color: #3B73B9;
text-decoration: none;
}

a:visited {
color: #3B73B9;
text-decoration: none;
}

a:active {
color: #3B73B9;
text-decoration: none;
}

a:hover {
color: #064D6E;
text-decoration: underline;
}

谢谢。

最佳答案

您可以使用非正常的 css 选择器:

a[href="http://example.com"] {
color: #1f6053;
}

用于豁免链接。

也可以使用:not :

a:not(#example) {
color: blue;
}

并插入到目标元素id="example"

还有:

i > a {
color: red;
}

选择目标<a>

关于html - 如何将 css 样式应用于标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24339677/

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