我想強調所有鏈接,但是如果鏈接是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