I want to hide the text that is in the <span>. but why doesn't it work?

I want to hide the text that is in the <span> . but why doesn't it work?

 .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> 
+4
source share
5 answers

text alignment

Applies to: block level elements, table cells and embedded blocks

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

Span is built-in by default.

The required value is also a length and therefore requires units if the value is nonzero.

It seems little use to include information in a document if you are going to hide it. I assume that you are trying to provide information to screen readers, and not to all users ... but this information is also useful to people who do not use screen readers.

+4
source

Use .pdf {display: none}

+11
source

I thought hiding with CSS works like this:

 .pdf { display: none; } 
+4
source

If you want to hide it, use CSS designed for this purpose:

 .pdf { visibility: hidden; display: none; } 
+1
source

try it

 .pdf {display: block; height: 40px; line-height: 200px;} 
0
source

Source: https://habr.com/ru/post/1306229/


All Articles