Box Model

Width & Height Border Padding Overflow Visibility

This cheat sheet dipicts the Box Model and different attributes associated to edit and revies for a clear more consise website.

Width & Height

p { height: 80px; width: 240px;}

width and height: The width and height of the content area.

Border

p.content-header { height: 80px; width: 240px; border: 3px solid coral; border-radius: 5px;}

Border is a line that surrounds an element, like a frame around a painting. Borders can be set with a specific width, style, and color:

Padding

p.content-header { border: 3px solid coral; padding: 10px;}

The amount of space between the content area and the border.If you want to be more specific about the amount of padding on each side of a box’s content, you can use the following properties:

Minimum and Maximum Height & Width

p { min-width: 300px; max-width: 600px;}

Minimum and Maximum Height and Width: Because a web page can be viewed through displays of differing screen size, the content on the web page can suffer from those changes in size.

Overflow

p { overflow: scroll; }

Overflow property controls what happens to content that spills, or overflows, outside its box. The most commonly used values are:

Visibility

p { visibility: hidden; }

Visibility: elements can be hidden from view with the visibility property. The visibility property can be set to one of the following values:

Attribute CSS Code
Width & Height p { height: 80px; width: 240px;}
Border p.content-header { height: 80px; width: 240px; border: 3px solid coral; border-radius: 5px;}
Padding p.content-header { border: 3px solid coral; padding: 10px;}
Overflow p { overflow: scroll; }
Visability p { visibility: hidden; }