Home >Web Front-end >HTML Tutorial >How to adjust the size of images in html web pages?
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!