【问题标题】:Hyperlink text change without effect of other links like title text, popular post and etc超链接文本更改不受标题文本、热门帖子等其他链接的影响
【发布时间】:2019-03-11 08:23:05
【问题描述】:

我想更改单个帖子中超链接的文本颜色,因为它与其他文本相似,并且我正在使用具有自定义主题的博客。问题是当我使用 CSS 更改链接文本颜色时

a { color: yellow;}

它改变了我整个网站的链接颜色,所以请帮我解决这个问题。 提前致谢 My website link

【问题讨论】:

  • 试试 a:nth-child(n) 其中 n 是那个anker标签的编号
  • 不工作 a:nth-child(n) 的工作类似于 a
  • 给那个anker标签一个id然后应用css。
  • 好的,让我检查一下
  • @Usman 我找不到anker标签,我在哪里可以找到

标签: css templates blogs blogger


【解决方案1】:

您可以在 CSS 中使用 id 或 class。

一个例子:

.pink-link {
  color: pink;
}

#red-link {
  color: red;
}
<a href="">First Link</a>
<br/><br/>
<a href="" class="pink-link">Coloured Link (class)</a>
<br/><br/>
<a href="" id="red-link">Coloured Link (id)</a>

【讨论】:

    猜你喜欢
    • 2014-06-17
    • 1970-01-01
    • 2017-07-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多