当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
Hugo搭建个人博客
I/O性能与可靠性
TCP/IP four-layer model
干货!教您使用工业树莓派结合CODESYS配置EtherCAT主站
disabledDate 日期选择器 datePicker
ROS2下使用ROS1 bag的方法
千亿IT运维市场,产品要凭实力说话
初识网页与浏览器
程序员应该这样理解I/O
May I ask how to read the binlog of the two tables of hologres through flink sql, and then how to join?
单臂路由实验和三层交换机实验
What?CDN cache acceleration only works for accelerating static content?
[ingress]-ingress使用tcp端口暴露服务
Call the TensorFlow Objection Detection API for object detection and save the detection results locally
js dynamically get screen width and height
[Day1] VMware software installation
By solving these three problems, the operation and maintenance efficiency will exceed 90% of the hospital
网络不通?服务丢包?看这篇就够了
云计算——osi七层与TCP\IP协议
Billions of IT operations in the market, the product by strength to speak