CSS adjusts the size of images. You need to know width and height.

高洛峰
Release: 2017-02-08 10:11:33
Original
2323 people have browsed it

What we are learning today is to teach you how to use CSS to adjust the size of images. In the previous course examples, we came into contact with the two properties of width and height. These two properties are used to set the width and height of elements respectively. of.
In CSS, we also use width and height to define the size of images. Grammar:

CSS adjusts the size of images. You need to know width and height.

Description: In the beginner stage of CSS, all units are pixels. In the advanced stage of CSS, we will explain other CSS units in depth. Examples:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <style type="text/css">
        img{width:60px;height:60px;}
    </style>
</head>
<body>
    <img src="../App_images/lesson/run_cj/cartoongirl.gif" alt=""/>
</body>
</html>
Copy after login

The preview effect in the browser is as follows:

CSS adjusts the size of images. You need to know width and height.

## Analysis: No matter what the actual size of the image is, you can use width and height to define the height and height you want. width. Don’t be so stupid as to use PS to make the height and width before you dare to use that picture on the page.

For more CSS to adjust the size of images, if you want to know about width and height related articles, please pay attention to 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!