There are several ways to introduce css

醉折花枝作酒筹
Release: 2023-01-05 16:10:50
Original
14387 people have browsed it

There are four ways to introduce css: 1. Use "" to introduce css styles; 2. Use "@import "css file address"" to introduce css styles; 3. Write the css style in the style tag; 4. Use the style attribute to write the css style in the element tag.

There are several ways to introduce css

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

(1) Link type: Use the tag in the

tag pair of the web page to introduce external style sheet files, and use html rules to introduce external css (use more More) :

<link href="./mystyle.css" rel="stylesheet" type="text/css"/>
Copy after login

(2) Import type: Introduce an independent .css file into the HTML file. The import type uses CSS rules to introduce external CSS files. The