Этот перевод не завершен. Пожалуйста, помогите перевести эту статью с английского

Глобальный атрибут hidden- это логический атрибут, указывающий, что элемент еще не установлен или больше не является актуальным. Например, его можно использовать для скрытия элементов страницы, которые не могут использоваться до завершения процесса входа в систему. Браузеры не будут отображать элементы с набором атрибутов hidden.

The hidden attribute must not be used to hide content that could legitimately be shown in another presentation. For example, it is incorrect to use hidden to hide panels in a tabbed dialog, because the tabbed interface is merely a kind of overflow presentation — one could equally well just show all the form controls in one big page with a scrollbar. It is similarly incorrect to use this attribute to hide content just from one presentation — if something is marked hidden, it is hidden from all presentations, including, for instance, screen readers.

Hidden elements shouldn't be linked from non-hidden elements, and elements that are descendants of a hidden element are still active, which means that script elements can still execute and form elements can still submit. Elements and scripts may, however, refer to elements that are hidden in other contexts.

For example, it would be incorrect to use the href attribute to link to a section marked with the hidden attribute. If the content is not applicable or relevant, then there is no reason to link to it.

It would be fine, however, to use the ARIA aria-describedby attribute to refer to descriptions that are themselves hidden. While hiding the descriptions implies that they are not useful on their own, they could be written in such a way that they are useful in the specific context of being referenced from the element that they describe.

Similarly, a canvas element with the hidden attribute could be used by a scripted graphics engine as an off-screen buffer, and a form control could refer to a hidden form element using its form attribute.

Note: Changing the value of the CSS display property on an element with the hidden attribute overrides the behavior. For instance, elements styled display: flex will be displayed despite the hidden attribute's presence.


Specification Status Comment
HTML Living Standard
Определение 'hidden' в этой спецификации.
Живой стандарт No change from latest snapshot, HTML 5.1
HTML Living Standard
Определение 'Hidden elements' в этой спецификации.
Живой стандарт Defines the suggested default rendering of the hidden attribute using CSS
HTML 5.1
Определение 'hidden' в этой спецификации.
Рекомендация Snapshot of HTML Living Standard, initial definition

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Да) 4.0 (2) 11 (Да) (Да)
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 4 (Да) 4.0 (2) 11 (Да) (Да)

See also