HTML

1个成员

HTML元素 - img

发表于 2017-01-07 2879 次查看

定义

在文档中嵌入图像或视频片断。

Embeds an image or a video clip in the document.

注释

当此元素接收到 input 焦点时,并不会触发 onfocus 事件,除非该元素已经与 MAP 元素相关联。

从 Internet Explorer 5 起支持下列图像和视频文件格式。

  • .avi
  • .bmp
  • .emf
  • .gif
  • .jpg, .jpeg
  • .mov
  • .mpg, .mpeg
  • .png
  • .wmf
  • .xbm

当使用 IMG 元素显示静态图像时,请用 SRC 标签属性指定图像文件的 URL。当使用 IMG 元素显示视频片断或虚拟现实模型语言(VRML)世界时,请用 DYNSRC 标签属性指定 URL。

此元素在 Internet Explorer 3.0 及以上版本的 HTML 中可用,在 Internet Explorer 4.0 及以上版本的脚本中可用。

此元素是一个内嵌元素。

此元素不需要关闭标签。

This element does not fire the onfocus event when it receives the input focus, unless it has been associated with a MAP element.

The following image and video file formats are supported as of Internet Explorer 5.

  • .avi—Audio-Visual Interleaved (AVI)
  • .bmp—Windows Bitmap (BMP)
  • .emf—Windows Enhanced Metafile (EMF)
  • .gif—Graphics Interchange Format (GIF)
  • .jpg, .jpeg—Joint Photographic Experts Group (JPEG)
  • .mov—Apple QuickTime Movie (MOV)
  • .mpg, .mpeg—Motion Picture Experts Group (MPEG)
  • .png—Portable Network Graphics (PNG)
  • .wmf—Windows Metafile (WMF)
  • .xbm—X Bitmap (XBM)

When using the IMG element to display a static image, specify the URL of the image file with the SRC attribute. When using the IMG element to display a video clip or virtual reality modeling language (VRML) world, specify the URL with the DYNSRC attribute.

The img element is available in HTML as of Internet Explorer 3.0, and in script as of Internet Explorer 4.0.

This element is an inline element.

This element does not require a closing tag.

示例代码

<img src="../images/html_tutorials/blabla_logo.gif">
发表回复
你还没有登录,请先登录注册