jQuery selector for first row of inline-block divs

后端 未结 4 1082
生来不讨喜
生来不讨喜 2021-02-11 06:24

I have some divs with display: inline-block; and I have to select first row of divs and set them for example different border color and I need to do it in javaScript (jQuery).

4条回答
  •  执念已碎
    2021-02-11 07:03

    $('.item').eq(0).addClass('special-border');
    
    .special-border {
        border-color: #00f;
    }
    

    http://jsfiddle.net/8193xgfn/9/

提交回复
热议问题