在我的網站我有一個與目標=「_ blank」的鏈接。在其中一些鏈接上,我希望光標是一個指針。在類名「內聯鏈接」的鏈接上,我希望它是文本。我用我的整個CSS頁面更新了這篇文章。CSS選擇器:不是不是從指定類的重寫CSS
但是我似乎無法重寫CSS。
這裏是我的 '完整' 的CSS:
.grouped-link {
cursor: pointer;
}
.slideout-link {
span.show:hover {
color: $darkgrey;
}
}
.section-subtitle a, a.section-subtitle {
color: $darkgrey;
float: right;
text-transform: uppercase;
font-size: 16px;
font-weight: 400;
letter-spacing: 2px;
margin-top: 65px;
text-decoration: none;
border-bottom: 1px solid $darkgrey;
&:hover {
border-color: $midgrey;
color: $midgrey;
text-decoration: none;
}
}
.underline-link {
border-bottom: 1px solid $lightgrey;
cursor: pointer;
padding-bottom: 5px;
text-transform: uppercase;
width: 150px;
&.dark {
border-color: $grey;
color: $grey;
}
&:hover {
border-color: $midgrey;
color: $midgrey;
text-decoration: none;
}
&.light {
border-color: $upmidgrey;
color: $upmidgrey;
}
&.lightest {
color: $lightgrey;
}
}
.inline-link {
color: $grey;
cursor: text;
&:hover {
text-decoration: none;
cursor: text;
}
}
a[target="_blank"]:not(.inline-link):hover {
text-decoration: none;
cursor: pointer;
}
這裏是我的html:
<p> Text text text <a className="inline-link" href="http://www.link.com" target="_blank">text</a> text </p>
我其實已經試過了,它的工作原理,你應該提供完整的'CSS'。爲了有效地覆蓋樣式,你需要使用完全相同的選擇器,即'.parent.parent.parent .child .inline-link&:hover'等。 – masterpreenz