当前位置:网站首页>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 .
边栏推荐
- Clickhouse learning (IX) Clickhouse integrating MySQL
- DAY15:文件包含漏洞靶场手册(自用 file-include 靶场)
- Wapiti是什么以及使用教程
- Hcia-r & s self use notes (27) comprehensive experiment
- Laravel服务容器(上下文绑定的运用)
- Relationship between link and @import
- [typescript] type reduction (including type protection) and type predicate in typescript
- Merge the same items in the same column in table
- uniapp组件之倒计时(如阅读协议倒计时、完成学习倒计时)
- rem与px与em异同点
猜你喜欢
QT setting background image method
ClickHouse学习(二)ClickHouse单机安装
Basic concepts of MySQL + database system structure + extended application + basic command learning
[C language series] - three methods to simulate the implementation of strlen library functions
eggjs 创建应用知识点
Sliding switch of tab of uniapp component
Use QSS to style the form
JDBC连接数据库详细步骤
[C language series] - detailed explanation of file operation (Part 1)
Clickhouse learning (IV) SQL operation
随机推荐
弹性盒子flex
Realize simple database query (incomplete)
Thrift安装手册
记xx公司SQL注入漏洞
·Let's introduce ourselves to the way of programming·
nmap是什么以及使用教程
href与src的区别
eggjs 创建应用知识点
表格与表单相关知识点总结
Laravel服务容器(上下文绑定的运用)
Clickhouse learning (VII) table query optimization
Win10 搭建MSYS2环境
link与@import导入外部样式的区别
微信小程序-屏幕高度
【TypeScript】深入学习TypeScript函数
uniapp组件之选择选项(如套餐选择)
Merge the same items in the same column in table
Talking about Servlet
使用Qss设置窗体样式
字符类型转换