In this chapter you will learn:
CSS height property is a common property of css which is used by many elements or tags to set the height. You can use this property to set the height of image, paragrapg, division etc and make your website attractive and impressive.
About height property
Example of height property
Syntax:
height:value;
Example of this property:
<html> <head> <title>Example of height property</title> <style type="text/css"> img { height:100px;/* height property */ } p { background-color:cyan; height:30px;/* height property */ } div { background-color:Blue; height:70px;/* height property */ } </style> </head> <body> <img src="css-icon.jpg" alt= "image of css icon"/> <p> This is the example of height property</p> <div> This is the example of height property</div> </body> </html>
Output:-
Summary
In this chapter, you have learned about height property and a program is also given to you better guide so try it yourself and click on Next button to continue-