Home > Web Front-end > CSS Tutorial > 3 ways to use CSS

3 ways to use CSS

藏色散人
Release: 2020-05-24 13:46:18
forward
3164 people have browsed it

3 ways to use CSS

(1) Link type: (externally imported .css file)

(used more often) is referenced before the html is loaded

Introduce external style sheets using in the tag pair of the web page, and use html rules to introduce external css:

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

Import type: (external import. css file) 

(not used) @import is referenced only after the html is loaded, and styles cannot be inserted into the JS DOM model

Introducing external CSS files, the