【问题标题】:Is there a way to specifically style all the table cells on the left, or a specific column?有没有办法专门设置左侧所有表格单元格或特定列的样式?
【发布时间】:2014-12-28 23:09:08
【问题描述】:

我正在处理一个 HTML 表格,我正在寻找一种方法来快速设置左侧所有单元格的样式。我应该为每个适当的<td> 标签使用一个类,还是有一个 CSS 选择器来查找左侧的标签?

【问题讨论】:

    标签: html css html-table css-selectors


    【解决方案1】:

    您可以使用first-child 选择器完成此操作。

    table td:first-child {
        color:blue; 
    }
    

    这是小提琴:

    http://jsfiddle.net/9p518dp7/

    【讨论】:

      猜你喜欢
      • 2014-05-30
      • 1970-01-01
      • 1970-01-01
      • 2023-02-25
      • 1970-01-01
      • 2019-10-14
      • 2018-07-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多