Width and height part 2

Width and Height Measurement



The width and height of an element can be also assigned using percents. 
In the example below the width of an element is assigned in percentages, the height is in pixels. 

The HTML:<div>The total width of this element is <strong>100%</strong> and the total height is <strong>100px</strong> .</div>
The CSS:
div {
border: 5px solid green;
width: 100%;
height: 90px;
}
Try It Yourself

Result:
Tap Try It Yourself to play around with the code!

Comments

Popular posts from this blog

font-family part 1