"; 2. Insert images through the background attribute "background"."/> "; 2. Insert images through the background attribute "background".">
Home >Web Front-end >Front-end Q&A >How to load images in html
htmlHow to load images: 1. Insert images through the img tag, code such as "ed79c694865dd54fe8a681f9b228893a"; 2. Insert through the background attribute "background" picture.
The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.
The first type: Insert pictures with img tags
<img src="h5course.png" alt="HTML5学堂">
The second type: Insert pictures through background images
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title></title> <style type="text/css"> .h5course { width: 200px; height: 200px; /* 图片路径记得修改哈 */ background: url('../images/h5course.jpg'); } </style> </head> <body> <div class="h5course">HTML5学堂</div> </body> </html>
Recommended tutorials: html video tutorials, css video tutorial
The above is the detailed content of How to load images in html. For more information, please follow other related articles on the PHP Chinese website!