当前位置:网站首页>The difference between link and @import importing external styles
The difference between link and @import importing external styles
2022-07-29 05:44:00 【Ice eyes JS】
The difference 1:link Belong to XHTML label ;@import Totally css One way to provide .
link In addition to being able to load css Outside , There are many other things you can do ; such as : Definition RSS, Definition rel Connection properties, etc .
The difference 2: Input mode
@import Input mode
1 <head>
2 <meta charset="utf-8">
3 <title>css Basic grammar </title>
4 <style type="text/css">
5 @import url(" Target file path and file name ");
6 </style></head>
link Input mode
1 <head>
2 <meta charset="utf-8">
3 <title>css Basic grammar </title>
4 <link rel= "stylesheet" type="text/css" href=" Target file path and file name " />
5 </style>
6 </head>
The difference 3: The loading order is different ,link Refer to the css Will be loaded at the same time ;@import References will wait until the page is completely downloaded before being loaded , So sometimes browse @import load css There is no style at the beginning of the page .
The difference 4: Compatibility differences :@import yes css2.1 Put forward ; browser IE5 The above version can be recognized .link No compatibility issues .
The difference 5: Use dom The difference in control style : When using JavaScript control dom To change the style , Only use link label . because @import No dom Controllable .
边栏推荐
- Laravel服务容器(继承与事件)
- Wapiti是什么以及使用教程
- Hcia-r & s self use notes (26) PPP
- 微信小程序更改属性值-setData-双向绑定-model
- Niuke network programming problem - [wy22 Fibonacci series] and [replace spaces] detailed explanation
- Hcia-r & s self use notes (27) comprehensive experiment
- Wechat applet - screen height
- href与src的区别
- Character type conversion
- Hcia-r & s self use notes (24) ACL
猜你喜欢

虚拟增强与现实第二篇 (我是一只火鸟)

Wapiti是什么以及使用教程

Qframe class learning notes

shell基本操作(下)

Hcia-r & s self use notes (27) comprehensive experiment

【TypeScript】深入学习TypeScript对象类型

Merge the same items in the same column in table

Masscan tutorial

Win10 搭建MSYS2环境
![[C language series] - string + partial escape character explanation + annotation tips](/img/75/698ba0672af9d6118ee7e2fdf6daae.png)
[C language series] - string + partial escape character explanation + annotation tips
随机推荐
Related knowledge of elastic box
TXT 纯文本操作
Summary of knowledge points related to forms and forms
Qframe class learning notes
Sliding switch of tab of uniapp component
Basic concepts of MySQL + database system structure + extended application + basic command learning
实现table某个单元格背景色设置
Realize simple database query (incomplete)
微信小程序-屏幕高度
弹性盒子相关知识
Go|Gin 快速使用Swagger
href与src的区别
HCIA-R&S自用笔记(26)PPP
Playwright实战案例之爬取js加密数据
Wapiti是什么以及使用教程
获取水仙花数
基础爬虫实战案例之获取游戏商品数据
eggjs 创建应用知识点
uniapp页面标题显示效果
[C language series] - realize the exchange of two numbers without creating the third variable