开发者

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

开发者 https://www.devze.com 2022-12-26 13:52 出处:网络
I want to hide text which is in <span> . but why it\'s not working? .pdf {text-indent: -9999} <p>

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">&l开发者_运维技巧t;img src="pdf.gif" alt="PDF" width="16" height="16" />
   <span class="pdf">PDF 34KB, Opens in a new window</span> </a>
</p>


Use .pdf {display: none}


I thought hiding with CSS worked like this:

.pdf {
  display: none;
}


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.


If you want to hide it, use the CSS that is intended for that purpose:

.pdf { visibility: hidden; display: none; }


try this

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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号