HTML uses img tag to create images

php中世界最好的语言
Release: 2018-03-08 17:12:14
Original
2105 people have browsed it

This time I will bring you the use of img tags to create images in HTML. What are the precautions for using img tags in HTML to create images? Here are practical cases, let’s take a look.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML:基础img标签 做一个图库</title>
</head>
<body>
 <h1>收藏的图片</h1>
 <img  src="1.jpg"    style="max-width:90%"  style="max-width:90%" alt="HTML uses img tag to create images" >
 <img  src="2.jpg"    style="max-width:90%"  style="max-width:90%" alt="HTML uses img tag to create images" >
 <img  src="3.jpg"    style="max-width:90%"  style="max-width:90%" alt="HTML uses img tag to create images" >
 <img  src="4.jpg"    style="max-width:90%"  style="max-width:90%" alt="HTML uses img tag to create images" >
 <img  src="5.jpg"    style="max-width:90%"  style="max-width:90%" alt="HTML uses img tag to create images" >
 <img  src="6.jpg"    style="max-width:90%"  style="max-width:90%" alt="HTML uses img tag to create images" >
 <img  src="7.jpg"    style="max-width:90%"  style="max-width:90%" alt="HTML uses img tag to create images" >
 <img  src="8.jpg"    style="max-width:90%"  style="max-width:90%" alt="HTML uses img tag to create images" >
 <img  src="9.jpg"    style="max-width:90%"  style="max-width:90%" alt="HTML uses img tag to create images" >
 <img  src="10.jpg"    style="max-width:90%"  style="max-width:90%" alt="HTML uses img tag to create images" >
 <img  src="11.jpg"    style="max-width:90%"  style="max-width:90%" alt="HTML uses img tag to create images" >
 <img  src="12.jpg"    style="max-width:90%"  style="max-width:90%" alt="HTML uses img tag to create images" >
 <img  src="13.jpg"    style="max-width:90%"  style="max-width:90%" alt="HTML uses img tag to create images" >
 <img  src="14.jpg"    style="max-width:90%"  style="max-width:90%" alt="HTML uses img tag to create images" >
 <img  src="15.jpg"    style="max-width:90%"  style="max-width:90%" alt="HTML uses img tag to create images" >
 <img  src="16.jpg"    style="max-width:90%"  style="max-width:90%" alt="HTML uses img tag to create images" >
</body>
Copy after login

HTML uses img tag to create images

</html>
// 源码讲解
src:图片的路径
width:设置图片的宽度
height:设置图片的高度
alt:图片无法显示则显示描述文字(图库例子中并没有用这个属性)
关于路径分为相对路径和绝对路径
 但有盘符的就是绝对路径 比如:file:///C:/Users/windows/Desktop/html/index.html(我的文件放到了桌面html文件夹的地方)
Copy after login

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Related reading:

Inline style improvement in HTML "San Mao's Classic Quotes"

Frequently Asked Questions in HTML 2

#What are the common problems with CSS selectors

The above is the detailed content of HTML uses img tag to create images. 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