Hiding an element that contains only spaces using CSS

前端 未结 9 464
不思量自难忘°
不思量自难忘° 2021-01-07 17:34

I am trying to hide the following element in an automatically generated HTML document:

  

9条回答
  •  -上瘾入骨i
    2021-01-07 17:57

    css:

    .sitspagedesc:empty
    {
    display:none;
    }
    

    jquery:

    $('.sitspagedesc').html(function(){
    // empty element
    return $.trim($(this).html());
    });
    

提交回复
热议问题