How to load a CSS file in HTML?

It can be loaded via the link tag:

<link rel="stylesheet" href="wcss.css" type="text/css" />

It can also be loaded by @import

<style type="text/css">  
    @import url(demo.css);  
</style>

Note that loading in the @import method will cause the CSS file to be loaded after the HTML page is loaded, that is to say, the page is streaking before loading the CSS file, but the response speed of entering the website will be faster!

<html>

<head>

<link rel="stylesheet" href="wcss.css" type="text/css" />

<title>test load css</title>

</head>

<body>

//...

</body>

</html>


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325784363&siteId=291194637