geoffs3310 geoffs3310 -4 years ago 101
CSS Question

how do i hide anchor text without hiding the anchor

say I have the following markup:

<li><a href="somehwere">Link text</a></li>


If i have a background image on the a tag how would I hide the link text using just css? font-size:0 seems to work fine on the a tag apart from in ie7 little blobs show.

Thanks


  • Thanks for help so far iv used line-height: 0; and font-size:0; and text-indent: -999px; but it still shows up some blobs in safari, any ideas?


Answer Source

Try

 a{
    line-height: 0; 
    font-size: 0;
    color: transparent; 
 }


The color: transparent; covers an issue with Webkit browsers still displaying 1px of the text.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download