CSS Box Model Flashcards
Padding
-Separates the content from the border
Margin
-Area outside the border and is used to control the space between other elements.
-Vertical margin and horizontal margin
Code:
auto (centers the page)
margin: 2px //top and bottom 0 //left and right
Div element
Code:
<div></div>
Add divisions to a page
Link
- Self closing element
- You can link the CSS file here
Border shorthand
.class {
border: line-width line-style color
Overflow
Filter
-Applying filters
Code used:
filter: blur(2px);
Box-shadow
Border-radius
Defines the border radii with pixels. Rounds the edges
Transform
Can rotate an object in degrees
Code:
transform: rotate(0.6deg) (can also use negative to rotate the opposite direction
Meta
-Goes in the head element
Code:
name=”viewport”
content=”width=device-width, initial-scale=1”
Box-sizing
Display using flex
Flexbox
Flexbox is a one-dimensional CSS layout approach that focuses on the flow of content. It offers the ability to control the way items are spaced and aligned within a container.
Flex direction
Specifies how flex items are placed in the flex container, by setting the direction of the flex container’s main axis.