Скройте легенду HTML-формы с помощью CSS

Да это делает. Проверьте этот экранная демонстрация в GitCasts.

5
задан Bobby Jack 8 July 2009 в 10:59
поделиться

4 ответа

Added as an answer instead of a comment so I can get more points. :-)

If you really want legends, have you tried putting a span inside the legend and positioning/manipulating that?

I understand this works in IE7 and Firefox...

7
ответ дан 18 December 2019 в 07:31
поделиться

Вы не можете сделать это в Firefox, потому что это ошибка браузера.

Вы можете узнать больше здесь

Ошибки браузера

6
ответ дан 18 December 2019 в 07:31
поделиться

For what it's worth - and I'm sure I'll get flamed for this - legend tags are one of the few places I deliberately break the spec by leaving them out. I replace them with a heading of the appropriate level which provides the same information to the user but without the browser bugs.

(I'm happy to hear about the real-world downsides of this if anybody can see some)

edit: Oh and you should ask yourself why assistive technology users would want to hear the legends when your browser using users don't. If the answer is simply to satisfy the HTML specs, use display:none and be done with it - don't hinder the user experience of one group by providing useless information just for a formality.

2
ответ дан 18 December 2019 в 07:31
поделиться

Вы можно попробовать:

legend
{
    position: absolute;
    top: -1000px;
}
0
ответ дан 18 December 2019 в 07:31
поделиться
Другие вопросы по тегам:

Похожие вопросы: