Home >Web Front-end >CSS Tutorial >CSS adjusts the size of images. You need to know width and height.
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:
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>
The preview effect in the browser is as follows: