codeGK
Code it ALL
CSS Height Width - CodeGK
♦ CSS Height Width

♣ About CSS Height Width

Height and Width can be set form HTML elements.
These properties can be set in different formats, which are tabularized below.
Below is a tabular explanation of Different Formats
Table Info
FormatFunctioning
autoDefault option, the browser determines Height and Width
lengthcan be em, px, pt, cm, in, etc
%percentage of blocks size(Height/Width)
initialsets Height/Width to elements Default value
inheritparent's value will be copied

♣ Example1: using pixels in CSS

In this example, pixels are used for dimensioning.
Example
Input:
Output:

♣ Example2: using % in CSS

In this example, the percentage is used for dimensioning.
Note that % symbol will not work for height, instead, use vh.
Example
Input:
Output:

♣ Example3: using em in CSS

In this example, em is used for dimensioning.
Example
Input:
Output:
Prev_LessonNext_Lesson
CSS Height Width