How to load images in html

藏色散人
Release: 2023-01-06 11:15:08
Original
8585 people have browsed it

htmlHow to load images: 1. Insert images through the img tag, code such as ""; 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学堂">
Copy after login

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>
Copy after login

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!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!