HTML Tag 您所在的位置:网站首页 民国著名的军阀有哪些名字 HTML Tag

HTML Tag

2023-06-22 10:24| 来源: 网络整理| 查看: 265

HTML tag is used to add image inside webpage/website. Nowadays website does not directly add images to a web page, as the images are linked to web pages by using the tag which holds space for the image.

Syntax:  

Attributes: The tag has following attributes.

 

src: It is used to specify the path to the image.alt: It is used to specify an alternate text for the image. It is useful as it informs the user about what the image means and also due to any network issue if the image cannot be displayed then this alternate text will be displayed.crossorigin: It is used to import images from third-party sites that allow cross-origin access to be used with canvas.height: It is used to specify the height of the image.width: It is used to specify the width of the image.ismap: It is used to specify an image as a server-side image map.loading: It is used to specify whether a browser should defer loading of images until some conditions are met or load an image immediately.longdesc: It is used to specify a URL to a detailed description of an image.referrerpolicy: It is used to specify which referrer information to use when fetching an image i.e. no-referrer, no-referrer-when-downgrade, origin, origin-when-cross-origin, unsafe-url.sizes: It is used to specify image sizes for different page layouts.srcset: It is used to specify a list of image files to use in different situations.usemap: It is used to specify an image as a client-side image map.

 

Example 1: In this example we are using the tag along with src, width, height, and alt attributes.

 

HTML

     GeeksforGeeks logo          

Output:

img src with width and height

Example 2: In this example, we are adding the style attribute to add a border to the image.

HTML

     GeeksforGeeks logo      

Output:

image source with border

Supported Browsers: 

Google ChromeEdge 12 and aboveInternet ExplorerSafariOperafirefox


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有