当前位置:网站首页>link 和@improt的区别
link 和@improt的区别
2022-08-05 05:24:00 【MoXinXueWEB】
link 和@import 的区别
1、适用范围不同
@import: 可以在网页页面中使用,也可以在 CSS 文件中使用,用来将多 个 CSS 文件引入到一个 CSS 文件中;
link: 只能将 CSS 文件引入到网页页面中 。
2、功能范围不同
**@import:**是 CSS 提供的一种方式,就只能加载 CSS ;
link: 属于 XHTML 标签,link 标签除 了可以加载 CSS 外,还可以定义 RSS,定义 rel 连接属性等。
3、加载顺序不同
当一个页面被加载的时候,
@import: 引用的 CSS 会等到页面全部被下载完再被加载。所以有时候浏览@import 加载 CSS 的页 面时开始会没有样式(就是闪烁),网速慢的时候还挺明显 ;
link: 引用的 CSS 会同时被加载。
4、兼容性
**@import :**是 css2.1 提出的,所以老的浏览器不支持,@import 只有在 IE5 以上的才能识别;
link: 标签无此问题 。
5、控制样式时的差别
link: 方式可以让用户切换 CSS 样式.现代浏览器如 Firefox,Opera,Safari 都支持 rel=”alternate stylesheet”属性(即可在浏览器上选择不同 的风格), 当然你还可以使用 Javascript 使得 IE 也支持用户更换样式
6、权重区别
link 引入的样式权重大于@import 引入
边栏推荐
- idea 常用快捷键
- Spark source code-task submission process-6.2-sparkContext initialization-TaskScheduler task scheduler
- 618, you may be able to wake up a little bit
- Autoware--Beike Tianhui rfans lidar uses the camera & lidar joint calibration file to verify the fusion effect of point cloud images
- 交换机原理
- I/O性能与可靠性
- What are some things that you only know when you do operation and maintenance?
- Quick question and quick answer - FAQ of Tencent Cloud Server
- Getting Started Document 09 Standalone watch
- 7 steps to complete cloud monitoring
猜你喜欢
随机推荐
Insight into the general trend of the Internet, after reading this article, you will have a thorough understanding of Chinese domain names
请问下通过flink sql读取hologres 的两张表的 binlog,然后如何进行join?
浏览器存储WebStorage
Operation and maintenance engineer, come and pick up the wool
Browser Storage WebStorage
ROS video tutorial
The problem come from line screening process
Technology Sharing Miscellaneous Technologies
Introductory document 05-2 use return instructions the current task has been completed
[Day8] Commands involved in using LVM to expand
Spark source code - task submission process - 4-container to start executor
What should I do if the SSL certificate prompts that it is expired or invalid?
CIPU, what impact does it have on the cloud computing industry?
[Problem has been resolved]-Virtual machine error contains a file system with errors check forced
单臂路由实验和三层交换机实验
js dynamically get screen width and height
媒体查询、rem移动端适配
Will intelligent operation and maintenance replace manual operation and maintenance?
I/O性能与可靠性
实力卷王LinkSLA,实现运维工程师快乐摸鱼





![[问题已处理]-虚拟机报错contains a file system with errors check forced](/img/07/1222a44dd52b359bf7873e6f3b7ebf.png)



