How to delete a string that does not have an html tag using CSS

advertisements

I need to remove strings that do not have an html tag.

For example :

<div class="A">
  <a href="#" class="link">keep this</a> and i want to remove this
</div>

Can I do this using only css ?


Maybe you can use font-size ::

.A {
  font-size: 0;
}
.A a {
  font-size: 20px;
}
<div class="A">
  <a href="#" class="link">keep this</a> and i want to remove this
</div>