Method: 1. Add CSS style to the style attribute in the element tag; 2. Add CSS style to the style tag pair in the head part of the document; 3. Put the CSS code into the ".css" file , imported using the "" statement.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
According to the position where the CSS style is written (or the way it is introduced), CSS style sheets can be divided into the following three categories:
Inline style sheet (inline)
Internal style sheet (embedded)
External style Table (linked)
The syntax format of the inline style sheet is as follows:
<div style="color: blue; font-size: 16px;">测试</div>
Note:
Inline style sheets set CSS styles in the style attribute inside the element tag, and are only suitable for modifying simple styles
The syntax format of the internal style sheet is as follows:
<style> div { color: blue; font-size: 16px; } </style>
Note:
Internal style The table extracts all the CSS code and puts it in a