css - 缩短逗号分隔的 CSS 选择器

标签 css css-selectors

可能这个问题的标题有歧义,我真正的意思是:

#footer_list li a:link, #footer_list li a:visited
{
    blah balh blah
}

这两个元素在CSS中有没有捷径?因此可以缩短 CSS 选择器

最佳答案

当然。如果你给他们每个人各自的类/ID 名称。但那是不必要的。您拥有的代码是完全可以接受的,因为 CSS 级联样式表,规则本质上是向下级联的。

关于css - 缩短逗号分隔的 CSS 选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3641056/

相关文章:

css - 如何在 jquery mobile 中正确使用 ui-btn-left 和 ui-btn-right 类

html - CSS 内容属性 : is it possible to insert HTML instead of Text?

php - 如何通过 Selenium 找到元素

css - 我可以合并 :nth-child() or :nth-of-type() with an arbitrary selector?

html - 在您的 css HTML CSS 中选择某个元素

css - 为什么这个 CSS 选择器不起作用 : a:hover ~ span?

jQuery 检查内联样式

html - float 元素的排序

css - 通过 CSS 设计 SOS 点功能

html - <a> 的事件类无法在重复的 <li> 元素中获取