Quick-level elements: <div>,<p>,Setting Display:block is the display of elements as block-level elements.
Converts inline element A to block-level elements so that a element has block-level element characteristics
A{display:block;}
inline elements: ,<span>,<a>,<label>,<input>,,<strong>,<em> in HTML is a typical inline element.
Display:inline
Inline block elements : with inline elements, block element features, code: Display:inline-block
,<input> tag is this inline block tag
Box Model:
Border: Is the line around the content and filler, which can set its thickness, style and color (border three properties)
div{
border:2px solid red;
}
Attention:
Border-style (border Style) common form:
Dashed (dashed line) dotted (dot) solid (solid)
Border-color (border color) color can be set to hexadecimal color
If you want to set the bottom border separately for the P label, and the other three sides do not set the border style:
div{border-bottom:1px solid Red;}
Width and Height: CSS defines the width and breadth of the content that is filled in.
An element's actual width = left boundary + right boundary + left padding + content width + right padding + right border + right boundary
The actual length of the element is: 10px+1px+20px+200px+20px+1px+10px=262px
Fill: the element content and the border can be set distance, called "fill"; fill can also be divided into upper, right, bottom, left (clockwise)
div{padding:20px 10px 15px 30px;}
Four directions for Padding-top Padding-right Padding-bottom padding-left
Boundary:The distance between elements and other elements can be set using boundaries (margin), which can also be divided into upper, right, bottom, and left
div{margin:20px 10px 25px 30px;}
Four directions: margin-top margin-right Margin-bottom Margin-left
CSS element classification