【发布时间】:2010-10-19 10:54:40
【问题描述】:
我找到了Showing Hyperlink Cues with CSS 的一个简洁示例。但是在示例的 CSS 中,有三种不同的样式在我的脑海中应该做大部分相同的事情。或者至少,在我看来,我不应该使用所有这些。但我不确定我是否都得到了它们。他们在这里:
/* all A tags whose REL attribute equals pdf */
a[rel='pdf'] {
padding-right: 18px;
background: transparent url(icon_pdf.gif) no-repeat center right;
}
/* all A tags whose REL attributes has the letters pdf somewhere mixed in*/
a[rel*='pdf'] {
padding-right: 18px;
background: transparent url(icon_pdf.gif) no-repeat center right;
}
/* all A tags whose REL attribute contains the value pdf, seperated from other values with a space */
a[rel~='pdf'] {
padding-right: 18px;
background: transparent url(icon_pdf.gif) no-repeat center right;
}
我想我可以用最后一个替换前两个,但我不能 100% 确定我理解这些是如何工作的。有人愿意对此有所了解吗?
我的问题具体是这样的:我可以跳过其中的一两个,仍然在我的所有链接上得到相同的结果吗?
【问题讨论】:
-
那么,究竟是什么问题?
-
@Harmen:更新问题以明确
标签: css css-selectors