亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

HTML image

HTML Image


1001.jpg

#<img> ; ->image image


【Required attribute】

【1】src: address

【 2] alt: image alternative text for crawling by the exploration engine

[Optional attribute]

[1] height: image height

[2] width: image Width

【3】ismap: Define the image as a server-side image mapping


<img> is an empty tag, meaning that it only contains attribute and no closing tag.

To display an image on the page, you need to use the source attribute (src). src refers to "source". The value of the source attribute is the URL address of the image.

The syntax for defining images is:

<img src="url" alt="some_text">


The alt attribute is used to define a string of prepared replaceable text for the image.

The value of the replacement text attribute is user-defined.

<img src="../style/images/boat.gif" alt="Big Boat">

The image cannot be loaded in the browser At the same time, the replacement text attribute tells the reader the information they are missing. At this point, the browser will display this alternative text instead of the image.


#The height (height) and width (width) properties are used to set the height and width of the image.

The default unit of the attribute value is pixels:

<img src="../style/images/pulpit.jpg" alt="Pulpit rock" width="300" height="200">

Tip: It is a good practice to specify the height and width of the image. If an image has a specified height and width, the specified dimensions will be retained when the page loads. If the size of the image is not specified, the overall layout of the HTML page may be destroyed when the page is loaded.

Example

Add a background image:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
</head>
<body background="http://pic.58pic.com/58pic/15/97/99/27W58PICZS7_1024.jpg">
<h3>圖像背景</h3>
<p>gif 和 jpg 文件均可用作 HTML 背景。</p>
<p>如果圖像小于頁面,圖像會進行重復(fù)。</p>
</body>
</html>

Set the height and width of the image:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
</head>
<body >
<img src="http://www.w3school.com.cn/i/eg_cute.gif" width="50" height="50">
<br />
<img src="http://www.w3school.com.cn/i/eg_cute.gif" width="100" height="100">
<br />
<img src="http://www.w3school.com.cn/i/eg_cute.gif" width="150" height="150">
</body>
</html>


Continuing Learning
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> </head> <body > <p>創(chuàng)建圖片鏈接: <a href="http://ipnx.cn"> <img src="http://www.runoob.com/try/demo_source/smiley.gif" alt="HTML 教程" width="32" height="32"> </a> </p> </body> </html>
submitReset Code