当前位置:网站首页>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 .
边栏推荐
- Three handshakes and four waves for the interview summary
- Masscan使用教程.
- [electronic circuit] how to select ADC chip
- Playwright实战案例之爬取js加密数据
- [typescript] learn typescript object types in depth
- 【TypeScript】深入学习TypeScript函数
- QFrame类学习笔记
- ClickHouse学习(二)ClickHouse单机安装
- QT layout management -- Part stretch principle and sizepolicy
- [C language series] - print prime numbers between 100 and 200
猜你喜欢

OpenAtom OpenHarmony分论坛圆满举办,生态与产业发展迈向新征程

Hcia-r & s self use notes (26) PPP

DAY15:文件包含漏洞靶场手册(自用 file-include 靶场)

Clickhouse learning (V) cluster operation

Realize simple database query (incomplete)

Flask 报错 RuntimeError: The session is unavailable because no secret key was set.

uniapp组件之tab选项卡滑动切换

使用Qss设置窗体样式
![[typescript] learn typescript object types in depth](/img/87/a9fd2f177331863e06fcf14559eeed.png)
[typescript] learn typescript object types in depth

Hcia-r & s self use notes (25) NAT technical background, NAT type and configuration
随机推荐
【TypeScript】深入学习TypeScript对象类型
Windows下cmd窗口连接mysql并操作表
Fvuln-自动化web漏洞检测工具
Clickhouse learning (VII) table query optimization
公众号不支持markdown格式文件编写怎么办?
js简单代码判断打开页面的设备是电脑PC端或手机H5端或微信端
[sword finger offer] - explain the library function ATOI and simulate the realization of ATOI function
Wechat applet change attribute value -setdata- bidirectional binding -model
Hcia-r & s self use notes (27) comprehensive experiment
ThinkPHP6 输出二维码图片格式 解决与 Debug 的冲突
Do students in the science class really understand the future career planning?
Clickhouse learning (IV) SQL operation
第五空间智能安全⼤赛真题----------PNG图⽚转换器
Laravel服务容器(上下文绑定的运用)
The openatom openharmony sub forum was successfully held, and ecological and industrial development entered a new journey
Masscan使用教程.
HCIA-R&S自用笔记(27)综合实验
Niuke network programming problem - [wy22 Fibonacci series] and [replace spaces] detailed explanation
打印出1-100之间的所有质数
Display effect of uniapp page title