Home  >  Article  >  Web Front-end  >  How to adjust the size of images in html web pages?

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

黄舟
黄舟Original
2017-07-26 13:34:1814127browse

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>


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!

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