How to adjust the size of images in html web pages?

黄舟
Release: 2017-07-26 13:34:18
Original
14137 people have browsed it

CSS contains a width property that controls the width of an element. Like controlling fonts, we use px (pixels) to specify the width of the image.

For example, if we want to create a class selector named larger-image that sets the width of the HTML element to 500 pixels, we use:

<style>
  .larger-image {
    width: 500px;
  }
</style>
Copy after login


Task: Create a class selector named smaller-image, and then use it to change the image size so that the image is only 100 pixels wide.


The above is the detailed content of How to adjust the size of images in html web pages?. 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