How to select first 2
  • elements using css
  • 后端 未结 4 1415
    悲&欢浪女
    悲&欢浪女 2020-12-13 08:26

    Hi i want to apply css for first 2 elements (one,two) that are adjacent to first

    element.

    4条回答
    •  有刺的猬
      2020-12-13 08:56

      This should be compatible with IE8 (uses CSS 2.1 selectors only):

      li:first-child, li:first-child+li {
          color: blue;
      }
      

    提交回复
    热议问题