What are the types of style sheet css?

青灯夜游
Release: 2023-01-07 11:43:40
Original
10510 people have browsed it

There are three types of style sheet css: 1. Inline style sheet, which puts the CSS style directly in the tag within the line of code through the style attribute; 2. internal style sheet, which puts the CSS style in "

What are the types of style sheet css?

The operating environment of this tutorial: Windows 7 system, CSS3 version, Dell G3 computer.

One or more CSS styles can form a style sheet. Style sheets include inline style sheets, internal style sheets and external style sheets. There is no essential difference between them. They are all composed of one or more styles.

1. Inline style sheet

Inline style is to put the CSS style directly in the tag within the line of code, usually in the tag Among the style attributes, since the inline style is directly inserted into the tag, it is the most direct way, and it is also the most inconvenient style to modify.

Example:

<p style="background-color: #999900">行内元素,控制段落-1</p>
<h2 style="background-color: #FF6633">行内元素,h2 标题元素</h2>
<p style="background-color: #999900">行内元素,控制段落-2</p>
<strong style="font-size:30px;">行内元素,strong 比 em 效果要强</strong>
<div style="background-color:#66CC99; color:#993300; height:30px; line-height:30px;">行内元素,div 块级元素</div>
<em style="font-size:2em;">行内元素,em 强调</em>
Copy after login

2. Internal style sheet

The internal style sheet is included in