<figure> <picture> <source media="(min-width: 40em)" srcset="large.jpg 1024w, medium.jpg 640w, small.jpg 320y"> <img src="medium.jpg" alt="London by night"> </picture> <figcaption>A landscape of London by night</figcaption> </figure>
srcset
attribute; 320y
- invalid value. If you change y
to w
, then the code will be completely valid.main
elementmain
element. What is its purpose? Do the definitions of this element meet the W3C and WHATWG specifications?main
element does not have a single definition and in each specification it is different.main
element.main
tag with any semantics and describes the element as a container for the predominant content of any element. Also, according to the WHATWG, you are not prohibited from having several main
elements on one page. If you have several article
elements on the page, then you can select the main content of each article
with the help of the main
tag. <header> <h1>Main title</h1> <form action="/" method="get"> <input type="search"> <input type="submit"> </form> </header> <ul> <li><a href="/">Home</a></li> <li><a href="/products">Products</a></li> <li><a href="/about">About</a></li> </ul> <main> <article> <h1>Main title</h1> <p>This is the content of this section</p> </article> </main> <footer> <small>Copyright © Aurelio De Rosa 2014</small> </footer>
<header role="header"> <h1>Main title</h1> <form action="/" method="get" role="search"> <label for="search">Search:</label> <input id="search" type="search"> <input type="submit"> </form> </header> <nav role="navigation"> <ul> <li><a href="/">Home</a></li> <li><a href="/products">Products</a></li> <li><a href="/about">About</a></li> </ul> </nav> <main role="main"> <article role="article"> <h1>Main title</h1> <p>This is the content of this section</p> </article> </main> <footer role="contentinfo"> <small>Copyright © Aurelio De Rosa 2014</small> </footer>
nav
tag. To improve accessibility for old technologies that do not support new semantic tags, the header
, navigation
, main
, article
, and contentinfo
have been added to the header
, nav
, main
, article
, and footer
elements, respectively.search
role was added to the form. Then the label
element was added, which is associated with the input
element using the for
attribute.small
small
element is appropriate and give an example.small
element was introduced in HTML 4.01 and was intended to make the text small. In HTML5, this tag has been given a semantic meaning and is recommended to place in it various kinds of warnings, legal texts, etc., which should be written in small print. In this case, the text may look small, but this is no longer necessary. <img src="image.jpg" alt="London by night"> <small> .</small>
hgroup
tag was introduced just for these needs, but more recently it was removed from the specification. Can you describe why you abandoned the hgroup
and how they solve the problem with header layout today?hgroup
element was created in order to group headers ( h1
- h6
) and thereby exclude the possibility of inadvertently creating a sublevel in the hierarchy. In order to understand to which problem this tag still calls, let's consider the following markup: <article> <h1>Main title</h1> <h2>This is a subtitle</h2> <p>This is the content of this section</p> </article>
h1 | ---h2 | p
h2
element instead of being the content of the h1
element, regardless of whether it was planned to do so. If there was an intention to create a subtitle, and p
to associate with h1
, then this markup is incorrect.hgroup
element was created in order to solve this problem. However, it was removed from the HTML5 specification in April 2013 due to the lack of implementations and the absence of precedents, which makes its use unacceptable.h1
is set forth below: <article> <h1> Main title <span>This is a subtitle</span> </h1> <p>This is the content of this section</p> </article>
alt
attribute required for the img
element? If not, give an example in which the alt
attribute can be null. Will the availability of this element change in this case?img
tag, but the value of this attribute may be empty (i.e. alt=""
). It makes sense to leave the attribute value empty when the image is used only for decorative purposes and is not part of the page content. Regarding accessibility, if the alt
attribute contains nothing, then on-screen announcers will ignore the image. Leaving the attribute empty in this case is highly recommended, because something like the “Content Separator” will only annoy those who listen to the narrator.time
elementtime
element? <time datetime="2014-11-06">6</time>- <time datetime="2014-11-09">9 November 2014</time>
meter
and progress
meter
and progress
elements?meter
can be used to describe the hard disk space occupied.meter
element, the progress described by the progress
element may not be defined. For example, you could use this element to show that there is progress in completing the task, but you cannot indicate when the task will be completed.longdesc
attributelongdesc
attribute? Can you explain his purpose?longdesc
attribute of the longdesc
element was in the days of HTML4, but is still considered valid in HTML5. This attribute was made in order to allow more detailed description of images, rather than the alt
attribute. An interesting thing: instead of being a description of an image (as the alt
attribute does), longdesc
points to a hyperlink containing a description.longdesc
attribute: <img src="italy.jpg" alt="This image represents the map of Italy" longdesc="italy.html#description"> <!-- other content here ... --> <section id="description"> <h2>Italy</h2> <p>The shown map of Italy illustrates its division in regions...</p> </section>
mark
elementmark
element? Give an example of using this element.Source: https://habr.com/ru/post/244929/
All Articles