1. Some special font styles:
Indent 2 characters in first line: {text-indent:2em;}
Center horizontally: {text-align:center;}
Justify: {text-align:justify;}
Center vertically: {vertical-align:middle;}
Word spacing 2 characters: {letter-spacing:2em;}
Line spacing twice times: {line-height:2;}
2. The navigation bar is fixed somewhere on the page (relative to <body>):
{position:fixed;left:px;top:px;}
3. Block-level elements and inline elements:
Common block-level elements:<div>, <ul>, <ol>, <li>, <dl>, <dt>,
Common inline elements:, <input>, <select>, <strong>, <span>
Block-level elements cannot contain other block-level elements inside.
Block-level elements and inline elements can be passed {display:inline;} with {Dispay:block;} To convert.
4. The default value for margin and padding for a few HTML elements is not 0:
<body>, <p>, <ul>, <li>
5.CSS Style Precedence Summary:
(1) from high to Low: inline style (style directly written within HTML elements :style= ") >id selector >class selector > element;
(2) the introduced CSS style is higher than the style written within the HTML (<style type= "Text/css" >);
(3) with the same weight, the priority of important is high.
CSS partial styling-Special font formatting, navigation bar pinning, block-level elements and inline elements, margin and padding default values for HTML elements, CSS style prioritization, and more