Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I want to hide text which is in <span> . but why it's not working?

Tags:

css

xhtml

I want to hide text which is in <span> . but why it's not working?

.pdf {text-indent: -9999}

<p>
   <a href="reader_overview.pdf" title="Open in a new Window" target="_blank"><img src="pdf.gif" alt="PDF" width="16" height="16" />
   <span class="pdf">PDF 34KB, Opens in a new window</span> </a>
</p>
like image 262
Jitendra Vyas Avatar asked Apr 07 '10 12:04

Jitendra Vyas


3 Answers

Use .pdf {display: none}

like image 153
Thomas Bonini Avatar answered Nov 10 '22 07:11

Thomas Bonini


I thought hiding with CSS worked like this:

.pdf {
  display: none;
}
like image 39
Tomalak Avatar answered Nov 10 '22 06:11

Tomalak


text-align

Applies to: block-level elements, table cells and inline blocks

— http://www.w3.org/TR/CSS2/text.html

Span is, by default, inline.

The value it takes is also a length and so requires units if the value is non-zero.

There seems little point in including the information in the document if you are going to hide it though. I assume you are trying to provide information to screen reader users instead of all users … but that information is as useful to people not using screen readers.

like image 35
Quentin Avatar answered Nov 10 '22 07:11

Quentin