edit css style of an element with a space in its class name

后端 未结 3 987
广开言路
广开言路 2021-02-07 17:19

I\'m creating a tumblr them and I have to write an external CSS file but I am having trouble editing the css style of the post elements.

This its structure:

<         


        
3条回答
  •  春和景丽
    2021-02-07 18:02

    This might work:

    $('li').each(function() {     
        if($(this).attr('class').indexOf(" ")>-1) {
           $(this).css('border','1px solid #ff0000')
        }  
    }
    

提交回复
热议问题