How to avoid double borders on list of divs

后端 未结 5 1586
夕颜
夕颜 2021-01-23 04:01

I have a list of divs which are used as a FAQ. Sometimes the divs are listed below each other, sometimes there is text between them. When they are listed below one other, I have

5条回答
  •  -上瘾入骨i
    2021-01-23 04:47

    You sure can use jQuery to do this:

    $('.faq').each(function(){
        if($(this).next('.faq').length > 0){
            $(this).css({borderBottom:0});   
        }
    });
    

    JSFiddle

    For each .faq, if there is another .faq following, remove this bottom border.

提交回复
热议问题