batz batz - 1 month ago 15
CSS Question

Css - Select text inside element inside element, without whats in the outside div

I have a html div:

HTML

<li>
<a>Title</a>
(0)
</li>


I want to hide the "(0)" And leave the title.

I tried something like

CSS

li { display:none }
li a {display:block }


doesn't show the text inside the a tag after hides it.

How could I hide only what it is inside the div and not inside the a tag?

Answer

Try this

   li{
     visibility:collapse;
    }
    li a {
        visibility:visible;
    }

Demo

Comments