Chapter 11 - What is Height in CSS?

To specify the height of the content area or any other element which is either created by you with the help of css class; you can use the height property of css. The content area is inside the padding, border, and margin of the element.

Height

The height of an element is in your control if you are controlling with style sheet. Height property has 3 values to apply
    1. Auto
    2. Pixel
    3. Percentage
There are 2 further divisions of height property:-
  1. Max Height 

    • (none, pixel, percentage)
  2. Min Height 

    • (pixel, percentage)

Example for Height Properties:-

 /* Syntax of Height Properties in CSS*/

 height:value;
 max-height:value;
 min-height:value;
 

Also you can control the height of a line. It has 4 values to set the line height property:-
  1. Normal
  2. Number
  3. Pixel
  4. Percentage

Example for Line Height Property:-

 /* Syntax of Line Height Property in CSS*/

 line-height:value;
 

NOTE:- To use these properties and relevant values of height and line height, read posts on each topic in the next section of this blog.

3 comments: