CSS Box Model Flashcards
What is CSS Box Model
Idea that everything in CSS is a box.
What makes up the Box in Box Model
Inner ‘Content box’, surrounded by ‘Padding’, encased in a ‘Border’. Space between boxes is the ‘Margin’.
What CSS properties manipulates the content area?
Width and Height
Name the main Border Properties
Border-width
Border-style
Border-color
Define Border-width
Controls the thickness of the border
Define Border-color
Controls the color of the border
Define Border-style
Controls the line style - dashed, solid, etc.
A border of 5px is added to a 200x200 content box. What is the new size of the content box with border?
210x210px
What property can be set to have the border fit the established width and height parameters of content box?
box-sizing: border-box;
Write a border shorthand
border: width style color;
How do you make rounded corners in borders?
border-radius: px or %;
border-top-right-radius: 50%
border-bottom-left-radius: 50%
If adding multiple values to a border property, which order are the values applied?
top-right-bottom-left
What is padding?
Padding is the space between the content box and the border.
List the individual properties for padding.
padding-left:
padding-right:
padding-bottom:
padding-top:
What is padding shorthand
padding: 10px (applies to all sides)
padding: 5px 10px (vertical, horizontal)