Выводим микроразметку в разных ситуациях
Created
September 25, 2018 12:04
-
-
Save aktaumag/0bd19b252f4cee771b1a106cd0025e31 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Разметка формы поиска
Легче добавить это после формы поиска, чем в саму форму пытаться внедрить разметку.
Search
role="search"
to increase their discoverability to assistive technologies.label
element to explicitly associate text with form elements. Thefor
attribute of the label must exactly match theid
of the form control.label
elements, when next to a button with descriptive text. Ex. search field next to a button labeled search. In these cases you should still have alabel
in the markup, but you can hide it visually.WCAG 2.1 Guidelines
1.1.1 Non-text Content - All non-text content that is presented to the user has a text alternative that serves the equivalent purpose. (Level A)
1.3.1 Info and Relationships - Information, structure, and relationships conveyed through presentation can be programmatically determined or are available in text. (Level A)
2.4.6 Headings and Labels - Headings and labels describe topic or purpose. (Level AA)
3.3.2 Labels or Instructions - Labels or instructions are provided when content requires user input. (Level A)
4.1.2 Name, Role, Value - For all user interface components (including but not limited to: form elements, links and components generated by scripts), the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to user agents, including assistive technologies. (Level A)
Option #1: Search Input with Visible Label
Option #2: Hide the label element
Option #3: Use aria-label
Copy
Copied!