"; 2. Insert images through the background attribute "background"."/> "; 2. Insert images through the background attribute "background".">

Home  >  Article  >  Web Front-end  >  How to load images in html

How to load images in html

藏色散人
藏色散人Original
2021-05-24 10:31:548628browse

htmlHow to load images: 1. Insert images through the img tag, code such as "ed79c694865dd54fe8a681f9b228893a"; 2. Insert through the background attribute "background" picture.

How to load images in html

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(&#39;../images/h5course.jpg&#39;);
        }
    </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!

Statement:
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
Previous article:html tag meaningNext article:html tag meaning