Home Web Front-end HTML Tutorial Image tag in HTML

Image tag in HTML

Jun 04, 2018 pm 03:05 PM
html picture Label

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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

See all articles