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; } 

demo

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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -