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

3 ways to use CSS

May 24, 2020 pm 01:45 PM
css

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