Home  >  Article  >  Web Front-end  >  What is the difference between link tag link CSS and @import loading?

What is the difference between link tag link CSS and @import loading?

不言
不言Original
2018-08-08 09:42:281980browse

The content of this article is about the difference between link tag link CSS and @import loading? It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

link:Basic syntax

      <link rel="stylesheet" href="路径">

@import Basic syntax

     <style>
       @import url(地址);
       @import url("地址");
       @import “地址”;
三种写法都可以
     </style>

linkThe difference between label link CSS and @import loading

1. Type , link is the HTML tag, @import is the method provided by CSS

2. Loading sequence, link is loaded when the page is loaded, @import is loaded after the page is completely downloaded

3 , compatibility, @import is a method provided by css2.1, the old version does not support

4. The difference in using DOM to control elements, you can only use link when controlling page style with JS, @import cannot be controlled by DOM

Recommended related articles:

HTML tag: Summary of usage of img tag

html layout: implementation code of html three-column layout

The above is the detailed content of What is the difference between link tag link CSS and @import loading?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn