问答详情
源自:6-8 CSS3 结构性伪类选择器—nth-child(n)

选择器 怎么选择前面三个?

用一个代码选择前面三个怎么写

<ol>

    <li></li>

    <li></li>

    <li></li>

    <li></li>

    <li></li>

   <li></li>

   <li></li>

</ol>

提问者:qq_星屑丿叶空_0 2018-09-26 12:14

个回答

  • 维持心跳
    2019-01-19 17:16:26

    https://img2.mukewang.com/5c42ead70001d42205320201.jpg表中有列出

  • hallo__world
    2018-10-08 17:06:05

    ol>li:nth-child(-n+3),上面一个是错的,亲测

  • 一生为我画眉
    2018-09-28 16:45:04

    ol>li:nth-child(1,2,3)