html<figure> <figcaption> Label Definition illustrated

Source: Internet
Author: User

Originally wanted to divide two articles to explain the figure, figcaption, but these two labels are defined text, so we together to explain, we can more easily accept.

Everyone in the writing XHTML, HTML often use a picture list, image + title or picture + title + simple Description . Previous general wording:

<li>

<p>title</P>
</li>

In the HTML5, a new label is more semantically defined in this list of images, which is the figure tag.

The definition given by the Consortium: The figure tag specifies separate stream content (images, charts, photos, code, and so on). The content of the figure element should be related to the main content, but if deleted, it should not affect the flow of the document.

Instance code:

<figure>
<p> the Lupu Bridge on the Huangpu River </p>
</figure>

Try it yourself.

Figure used to replace the original Li tag, p tag who to replace it? The answer is:figcaption


The definition given by the Figcaption: the label defines the caption of the figure Element (caption). The "figcaption" element should be placed in the position of the first or last child element of the "figure" element.

Then the code above becomes:

<figure>
<figcaption> the Lupu Bridge on the Huangpu River </figcaption>
</figure>

Try it yourself.

---------------------------------------------------------------------------

This is a very easy to understand label, and its usage is very clear. Even if it is simple, it is recommended that you write them yourself.

html<figure> <figcaption> Label Definition illustrated

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.