Start tag: required, end tag: none
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 a1f02c36ba31691bcfe87b2722de723b 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]
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. |
【Features】
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 c32c1f0cf2c4789382020f567969fc21. |
##border=n |
H3-H4T/e2 /N2. Specifies the thickness of the border line around the image. When an image is included in a d632822ac9277025ec149ceea8685596~5db79b134e9f6b82c0b36e0489ee08ed tag, a border line will be automatically generated. If you want to cancel, set border=0.
|
##galleryimg =bool
| 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 e8e496c15ba93d81f6ea4fe5f55a2244 .
|
##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
| 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=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】
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 dab9f699790ab0922e596ecb9f6677d5.
|
【Video related attributes】
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 d8e2720730be5ddc9c2a3782839e8eb6 and 273238ce9338fbb04bee6997e5552b95 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]
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. |
【General attributes】
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
| H5. Draggable.
|
##dropzone
=value H5. Can be dragged and dropped. |
|
hidden
|
H5+。隐藏元素。 |
spellcheck=bool |
H5+。检查拼写。 |
IE扩展属性 |
可以指定IE扩展属性。 |
举例
HTML代码 <img src="image/kanami.jpg" alt="举例图片" width=100 height=100>
总结:以上就是本篇文的全部内容,希望能对大家的学习有所帮助。
相关推荐:
PHP里面把16进制的图片数据显示在html的img标签上的方法
正则表达式怎么匹配图片地址与img标签
在ie中img标签内存泄漏怎么处理
|