Home > Web Front-end > HTML Tutorial > Image tag in HTML

Image tag in HTML

墨辰丷
Release: 2018-06-04 15:05:05
Original
2701 people have browsed it

This article mainly introduces the relevant information of HTML image img tag. Friends who need it can refer to it

Abstract

Start tag: required, end tag: none

##project instruction

Form

##

Support

H2 / e2 / N2 / Fx1 / Op6 / Ch1 / Sa1

#Tag omitted

Description

img is the abbreviation of Image. The src attribute is used to specify the path to the image.

In HTML4.01, in order to cooperate with various browsers that cannot display images and audio reading browsers, the alt attribute in the tag must be set. HTML5 becomes optional.

Although the height attribute and width attribute are not necessary, if these two attributes are set, the image can be opened faster, and certain display bugs can be avoided when displaying the image.

Attributes

[Important attributes]

【Features】

Attribute

Meaning

src=url

H2 /e2 /N2. The path to the image. Required attribute.

##alt=alt

H2 /e2 /N2 . Description of the picture. When some browsers cannot display the image, you can see the description of the image on the web page. It is a required attribute in HTML4.01.

##height=n

H3 /e2 /N2 . Set the image height.

##width=n

H3 /e2 /N2 . Set the image width.

e6 . When the mouse is placed on an image larger than 200×200, the toolbar is not displayed. It can also be specified globally in e4 /N2. If an image is large, it may take some time to display in the browser. While the image is still being transmitted over the network, you can use the lowsrc attribute to specify a thumbnail so that it is displayed on the browser first, and the thumbnail will be automatically replaced after the original image is transmitted. ##suppress

Attributes

Meaning

##align= align

H2-H4T/e2 /N2 . Specify the display position of the image. Set align="right" and align="left" to display text on the left or right side of the image. To cancel this effect, use
.

##border=n

H3-H4T/e2 /N2. Specifies the thickness of the border line around the image. When an image is included in a ~ tag, a border line will be automatically generated. If you want to cancel, set border=0.

##galleryimg

=bool

.

##hspace=n

H3-H4T/e2 /N2. Sets the horizontal margin around the image.

##longdesc=url

H4. Use this attribute to point to the URL of the document containing the image description when the image description is too long for the title attribute to be displayed in full.

##lowsrc

=url

=suppress

N4. suppress means to suppress. The default value is false. If set to true , the image During transmission, the small icon that should be displayed at the image location will be replaced by a ToolTip (prompt box).

vspace=n

H3-H4T/e2 /N2. Sets the vertical space around the image.

name=name

H4/e4 /N3. Specify name.

【Clickable field related attributes】

【Video related attributes】

Attributes

Meaning

##ismap

H2 /e2 /N2 . Specifies the image as a server-side image map.

##usemap=usemap

H3 /e2 /N2 . Specifies the image as a client image map. Please refer to .

Attributes

Meaning

##controls

e2-e3. Displays playback controls below the video. Deprecated in IE4.0.

##dynsrc=url

e2. Specify video file (*.avi). Because there are already

and tags, this attribute is basically useless.

loop=n

e2. Set play times. loop=

infinite will play in an infinite loop.

start=start

e2. When set to fileopen , the web page will be played as soon as it is opened. When set to mouseover , the video will start playing when the mouse is placed on it.

[Data binding related properties]

【General attributes】

Attribute

Meaning

datafld=datafld

e4. Specify the column name of the data source for data binding.

##datasrc=datasrc

e4. Specifies the ID of the data source when binding data.

H5. Draggable. ##dropzonehidden

Attributes

means

##class=class

H4 /e3 /N4 . Specify the class.

id=id

H4 /e3 /N4 . Specify ID.

style=style

H4 /e3 /N4 . Specify the style.

title=title

H4 /e4 /N6. Specify a title.

##dir=dir

H4 /e5 /N6 . Specifies the direction in which text is displayed.

lang=lang

H4 /e4 /N6 . Specify the language type.

accesskey=key

H5. Assign shortcut keys.

##tabindex=n

H5. Specify the order in which the TAB keys move in the control.

##contenteditable=bool

H5 /e55 . Make the element editable.

##contextmenu=id

H5. Specify contextmenu.

##draggable

=bool

=value

H5. Can be dragged and dropped.

H5+。隐藏元素。

spellcheck=bool

H5+。检查拼写。

IE扩展属性

可以指定IE扩展属性。

举例

HTML代码

<img src="image/kanami.jpg" alt="举例图片" width=100 height=100>
Copy after login

总结:以上就是本篇文的全部内容,希望能对大家的学习有所帮助。

相关推荐:

PHP里面把16进制的图片数据显示在html的img标签上的方法

正则表达式怎么匹配图片地址与img标签

在ie中img标签内存泄漏怎么处理

The above is the detailed content of Image tag in HTML. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template