HTML
在本文中,我们将了解
HTML : HTML5 中的
句法:
属性:它主要包含两个标签,如下所示:
- img src :该标签用于在文档中添加图像源。
- figcaption :此标签用于设置图像的标题。它是可选的。
示例:此示例说明了
HTML
Document
HTML
Document
Geeks For Geeks
输出:在本例中,
HTML 标签: HTML 标签用于在网页/网站中添加图像或设置背景。现在的网站不直接将图像添加到网页,因为图像通过使用为图像保留空间的 标记链接到网页。
句法 :
属性:它包含以下属性值:
- src:用于指定源图片的URL路径。
- alt:如果由于某种原因无法显示图像,则用于指定图像的替代文本。
示例:在此示例中,我们使用 标记以及 src、width、height 和 alt 属性。
HTML
Document
Geeks For Geeks
输出:在 标签的情况下,它没有正确对齐并且非常靠近边缘,并且标题远离图像。图像和标题不是彼此的一部分。边框不是图像和标题的一部分。 标签是一个内联元素,但是当我们指定宽度和高度时,它就变成了一个块元素。
tag or tag to add pseudo captions.S.No.
Tag
1. The figure tag is used to semantically organize the content of images, videos, audios or even charts or tables, block of codes in the HTML document. The image tag is used to add an image to an HTML page. tag can only insert image. 2. tag is a void tag. 3. This tag provides a container for content that is equivalent to a figure or diagram in a book. The HTML tag is used for embedding images into an HTML document. 4. This tag is inline element. It is an inline element but when we specify width and height it becomes a block element. 5. You can use the figure element in conjunction with the figcaption element to provide a caption for the contents of your figure element. In image tag there’s no special tag for caption rather we can use 6. It makes it easy for the machine to understand the code. Easy to get on search engines. It is difficult for machines to understand. 7. The The tag can not have multiple elements inside it only images can be added in tag. 8. The figure tag contains default alignment and styling. The image tag does not contain any default alignment and styling.