我想强调所有链接,但是如果链接是h1,h2等,则不能。 这里是一个简单的CSS:选择所有没有h标签的链接
#heatmapthemead-the-content-container .entry-content a {
text-decoration: underline;
}
这强调所有环节,包括H1,H2,H3 当我使用:不选择器不工作,也H1,H2的逗留强调
#heatmapthemead-the-content-container .entry-content a:not(h1,h2,h3) {
text-decoration: none;
}
我也使用!重要的:
h1,h2,h3,h4,h5,h6 a {
text-decoration: none !important;
}
但h1,h2链接保持下划线。 有没有人有一招?
首先,从具有最少特异性的CSS选择器开始。是否有必要在CSS选择器中包含'#heatmapthemead-content-container .entry-content'?这是否过分矫枉过正?会做一些简单的工作,比如'h1 a'?根据需要始终以最小的特异性进行。 '重要的'通常用于非常特殊的情况,其中,这种情况似乎没有资格。 – hungerstar