插入图片
- 1.图片和网页文件在同一个文件夹里(相对路径)
<img src="css.jpg" width="200" height="300" alt="css实战手册" title="css实战手册"/>
"width"和"height"可用来调整图片大小。
“alt” 属性中指定的文本,但是仅支持文本的浏览器无法显示图像,如果无法显示图像,将显示 “alt” 属性中的文本:“css实战手册”。(注意alt属性是元素的必要属性)
“title”,当鼠标放在图片上时,显示“css实战手册”。
ps.图片也可以作为超链接.
- 2.调用别的固定文件夹里的图片(绝对路径)
<img src="G:\html\书店\img\css.jpg" width="200" height="300" alt="book" title="css实战手册"/>
- 3.调用网页上现成的图片(直接输入图片的网址)
<img src="https://img3.doubanio.com/view/subject/l/public/s29130641.jpg" width="200" height="300" alt="book" title="css实战手册"/>