what is the usage of HTML5 figure with img

后端 未结 3 1212
离开以前
离开以前 2021-02-01 01:57

Is there any specific advantage/usage of using HTML5

over ?

I think

is useless without , isn\'
相关标签:
3条回答
  • 2021-02-01 02:13

    Images are not technically inserted into an HTML page, images are linked to HTML pages. The <img> tag creates a holding space for the referenced image.

    While the content of the <figure> element is related to the main flow, its position is independent of the main flow, and if removed it should not affect the flow of the document

    From http://dev.w3.org/

    The img element represents an image. and the The figure element represents a unit of content, optionally with a caption, that is self-contained, that is typically referenced as a single unit from the main flow of the document, and that can be moved away from the main flow of the document without affecting the document’s meaning.

    0 讨论(0)
  • 2021-02-01 02:29

    HTML5 figure is used whenever you use img, video tag with caption (figcaption) on it

    If you have a number of related images (or other content) with caption text, you can use nested figure elements to associate both a group caption and an individual caption to each instance using the figcaption element.

    <figure role="group">
     <img src="castle-etching.jpg" alt="The castle has one tower, and a tall wall around it.">
     <figcaption>Charcoal on wood. Anonymous, circa 1423.</figcaption>
    </figure>
    

    Here are some examples

    0 讨论(0)
  • 2021-02-01 02:34

    The tag provides a container for content that is equivalent to a figure or diagram in a book. It can be used to group a caption with one or more images, a block of code or other content.

    In other words, enables us to work more freely, realistically with images, diagrams by enabling to group them & caption one or images with a single caption.

    Source: http://www.html-5.com/tags/figure-tag/index.html

    0 讨论(0)
提交回复
热议问题