我怎样才能实现li:last-child with less?

时间:2012-12-21 14:10:09

标签: css less

我有以下CSS:

ul.arbo {
    margin-top: 0.5em;
    }
ul.arbo li {color
    padding-bottom: 0.333em;
    }
ul.arbo li:last-child {
      color: #333;
    }

我可以使用Less实现简单的CSS。但是我该如何实现li:last-child?

1 个答案:

答案 0 :(得分:13)

尝试:

ul.arbo {
    margin-top: 0.5em;

    li {
        color: #444;
        padding-bottom: 0.333em;

        &:last-child {
         color: #333;
        }
    }
}