html - How to hide content that is not wrapped by tag using only CSS? -
i have following html:
<a href="..."><span>icon</span>text</a>
how can remove "text" using css rules? note: need continue see content.
based on paulie_d's answer, came solution using font-size
:
a { font-size: 0; } span { font-size: 16px; }
based on comments on answer, think might solution. isn't perfect, do. use answer font-size: 0
. paulie_d commented won't work crossbrowser, browser show in font-size of 4px. browser add paulie_d's solution too:
a { font-size: 0; visibility:hidden; } span { font-size: 16px; visibility:visible; }
to see difference between two: check here.
Comments
Post a Comment