当前位置:网站首页>Difference between link and @improt
Difference between link and @improt
2022-08-05 06:22:00 【MoXinXueWEB】
The difference between link and @import
1, different scopes
@import: Can be used in web pages or in CSS files to import multiple CSS files into one CSS file;
link: Only CSS files can be imported into web pages.
2, different functional scope
**@import:** is a way provided by CSS, only CSS can be loaded;
link: belongs to XHTML tags. In addition to loading CSS, link tags can also define RSS, define rel connection attributes, and so on.
3, different loading order
When a page is loaded,
@import: The CSS referenced will wait until the page is fully downloaded before being loaded.So sometimes when browsing @import and loading CSS pages, there will be no styles (that is, flickering), and it is quite obvious when the network speed is slow;
link: Referenced CSS will be loaded at the same time.
4. Compatibility
**@import :** is proposed by css2.1, so old browsers do not support it, and @import can only be recognized by IE5 or above;
link: tags do not have this issue .
5. Differences when controlling styles
link: This method allows users to switch CSS styles. Modern browsers such as Firefox, Opera, and Safari all support the rel=”alternate stylesheet” attribute (you can select different styles on the browser)), of course you can also use Javascript to make IE also support user changing styles
6, weight difference
The styles imported by link have more weight than those imported by @import
边栏推荐
- IP address and subnet division
- Quick question and quick answer - FAQ of Tencent Cloud Server
- 跨域的十种解决方案详解(总结)
- 通过反射获取Class对象的四种方式
- 网络布线与数制转换
- The spark operator - repartition operator
- spark source code - task submission process - 2-YarnClusterApplication
- CIPU, what impact does it have on the cloud computing industry?
- selenium模块的操作之拉钩
- 时间复杂度和空间复杂度
猜你喜欢
Autoware--Beike Tianhui rfans lidar uses the camera & lidar joint calibration file to verify the fusion effect of point cloud images
From "dual card dual standby" to "dual communication", vivo took the lead in promoting the implementation of the DSDA architecture
What are some things that you only know when you do operation and maintenance?
IP数据包格式(ICMP协议与ARP协议)
增长:IT运维发展趋势报告
[Paper Intensive Reading] The relationship between Precision-Recall and ROC curves
One-arm routing and 30% switch
解决这三大问题,运维效率将超90%的医院
Cloud computing - osi seven layers and TCP\IP protocol
交换机原理
随机推荐
VRRP概述及实验
正则表达式小实例--去掉字符串中间和两边的空格
Tencent greetings function SCF - entry instructions
spark source code-RPC communication mechanism
Take you in-depth understanding of cookies
增长:IT运维发展趋势报告
Apache configure reverse proxy
实力卷王LinkSLA,实现运维工程师快乐摸鱼
程序员应该这样理解I/O
Quick question and quick answer - FAQ of Tencent Cloud Server
千亿IT运维市场,产品要凭实力说话
LinkSLA insists that users come first and creates a sustainable operation and maintenance service plan
VLAN details and experiments
The spark operator - repartition operator
selenium模块的操作之拉钩
RAID disk array
js dynamically get screen width and height
磁盘管理与文件系统
网络布线与数制转换
Servlet跳转到JSP页面,转发和重定向