1. Inline CSS styles, written directly in existing HTML tags
Where can CSS styles be written? From the perspective of the form of CSS style code insertion, it can be basically divided into the following three types: inline, embedded and external.
The inline css style sheet is to write the css code directly in the existing HTML tag, such as the following code:
<p style="color:red">这里文字是红色。</p>
Be careful to write it in the start tag of the element, like the following The writing method is wrong:
<p>这里文字是红色。</p style="color:red">
and the css style code must be written in double quotes. If there are multiple css style code settings, they can be written together and separated by semicolons. The following code:
<p style="color:red;font-size:12px">这里文字是红色。</p>
2. Embedded css style, written in the current file
Inline styles can only be modified one by one, while embedded styles can set multiple text styles at one time.
Embedded css style means that the css style code can be written between the tags. For example, the following code sets the text in all tags to red:
<style type="text/css"> span{ color:red; } </style>
The embedded css style must be written between , and in general The embedded css style is written between
.