CSS3 Properties A-M

Common CSS properties from A to M

Background

background-color: #fff; # background color
background-image: url(img.jpg); # background image
background-size: cover; # cover, contain, or size
background-position: center; # position
background-repeat: no-repeat; # repeat pattern

Border

border: 1px solid black; # shorthand
border-width: 2px; # border width
border-style: solid; # solid, dashed, dotted
border-color: red; # border color
border-radius: 10px; # rounded corners

Box Model

width: 300px; # element width
height: 200px; # element height
padding: 20px; # inner spacing
margin: 10px; # outer spacing
box-sizing: border-box; # include padding/border in size

Display

display: block; # block element
display: inline; # inline element
display: inline-block; # inline with dimensions
display: none; # hide element
display: flex; # flexbox
display: grid; # grid

Font and Text

font-family: Arial, sans-serif; # font
font-size: 16px; # text size
font-weight: bold; # 400, 700, bold
color: #333; # text color
text-align: center; # alignment
line-height: 1.5; # line spacing