You can try font-size: 0 trick.
font-size: 0
div { font-size: 0; } div * { font-size: 1rem; }
<div> <span>text 1</span> unwanted text <span>text 2</span> </div>
2.1m questions
2.1m answers
60 comments
57.0k users