【问题标题】:CSS images next to links - more specific?链接旁边的 CSS 图像 - 更具体?
【发布时间】:2010-09-18 19:52:19
【问题描述】:

我正在使用这样的东西:

.entry a {
  padding: 2px 0 0 8px;
  background: transparent url(images/link_arrow_light.gif) left top no-repeat;
  text-decoration: underline;
}

效果很好,但将该图像添加到所有链接(图像、h3 标签、...)

有没有一种 css 方式让它只出现在 p-tags 中的链接之外?

【问题讨论】:

    标签: css image hyperlink


    【解决方案1】:
    .entry p a {
    

    这会强制<a>s 成为<p> 的后代(而<p>s 也必须是一些具有entry 类的标签的后代。)

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-10-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-21
    • 2013-12-21
    相关资源
    最近更新 更多