小编Ben*_*min的帖子

将[attribute = value]与:nth-​​child()结合使用

我正在使用LESS并希望匹配类型为文本的特殊输入.

目前,我这样做:

td {
    input[type=text] {
        width: 100px;
    }
}
Run Code Online (Sandbox Code Playgroud)

对于我的第二个类型复选框输入,我需要另一个宽度.我试过这个:

td {
    input[type=text] {
        width: 100px;

        &:nth-child(2) {
             width: 40px;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

但这不起作用.任何想法如何结合[type=text]使用:nth-child()

css css-selectors css3 less

3
推荐指数
1
解决办法
5769
查看次数

标签 统计

css ×1

css-selectors ×1

css3 ×1

less ×1