Height
height
does the same as width
, except making our image taller or shorter, instead of thicker or thinner. Height also uses pixels or percentages, and is often used alongside width to control the size of images.
Example
I can use width to specify how wide I want my image to be!
img {
height: 50%;
}
You can also give height the auto
value, which will change the image based on the size available for the image. This can be especially useful if you want your image height to be changeable.
If you want to know more about the height
property, you can go to the links at MDN Web Docs or w3schools. Both of these sites give excellent examples of the height CSS property that are interactive, and allow you to change and alter the values to see how the property works.