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

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

不言
Release: 2018-08-08 09:42:28
Original
2011 people have browsed it

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="路径">
Copy after login

@import Basic syntax

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

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template