byCoder
byCoder

Reputation: 9184

css hide first   in div, but only first

Are there any good ways, to hide first   in div, but only first?

For example I have this structure:

<div class="lalala">
 <div class="123">
    &nbsp; dfsdfsdf
     sdf sdf sd fsd f
      &nbsp; 
 </div>
 <div class="456">
   &nbsp; f dfgd
 </div>
</div>

As result I must see:

<div class="lalala">
     <div class="123">
        dfsdfsdf
         sdf sdf sd fsd f

Is it possible to do it in CSS only (and how?), or do I have to use JavaScript?

Upvotes: 1

Views: 1486

Answers (1)

Tibos
Tibos

Reputation: 27833

I don't think there is a CSS way to do it.

With JavaScript it's fairly simple though:

var el = document.querySelector('.123');
el.innerHTML = el.innerHTML.replace('&nbsp;', '');

Upvotes: 4

Related Questions