


The difference between imported style sheet CSS and linked style sheet CSS
<span style="font-family:Arial;"><!-- 链接外部样式:也就是在与<head>与</head>标记之间加入一个<link>标记。 --> <head> <link href=”style.css” rel=”stylesheet” type=”text/css” /> </head> <!-- 导入外部样式:在内部样式表的<style></style>标记之间导入一个外部样式表,导入时用@import。 --> <style type="text/css"> @import "CssStyle.css"; </style></span>
Because I can’t always tell the difference, I took a look while I still have some time
First of all, let’s distinguish between linking external styles and importing external styles:
We know that these two types of external references The style function is almost the same, both refer to independent CSS style files into web page files, but there are still some subtle differences between the two (because the design will not be boring enough to create two identical ones. things), let’s discuss it based on the two aspects I learned:
1. Using link link css means that when the client browses your web page, it first loads the external CSS file into the web page, and then compiles it. Display, so in this case the displayed web page has the same effect as we expected, even if the network speed is slow, the effect will be the same. The CSS imported using @import is different. When the client browses the web page, it first presents the structure of the html, and then loads the external CSS file into the web page. Of course, the final effect is the same as the former, but when When the network speed is slow, the HTML webpage without CSS unified layout will be displayed first, which will give readers a very bad feeling. This is also the main reason why the CSS of most websites now uses links;
2. Importing styles can avoid too many pages pointing to one css file. When there are not many pages using the same CSS file in the website, there is almost no difference between the two methods in terms of effect. However, when the number of pages on the website reaches a certain level (such as Sina and other portals), it may be difficult to use the link method. This will cause the speed to drop due to multiple pages calling the same CSS file, but generally websites that can reach this level of page will also have the capital to use the best hard disk, so there is no need to worry about this factor.
Based on the above two factors, we can find that most websites now prefer to use links to reference external CSS.
For more related articles on the difference between imported style sheet CSS and linked style sheet CSS, please pay attention to the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Let’s attempt to coin a term here: "Static Form Provider." You bring your HTML

At the start of a new project, Sass compilation happens in the blink of an eye. This feels great, especially when it’s paired with Browsersync, which reloads

In this week's roundup of platform news, Chrome introduces a new attribute for loading, accessibility specifications for web developers, and the BBC moves

This is me looking at the HTML element for the first time. I've been aware of it for a while, but haven't taken it for a spin yet. It has some pretty cool and

Buy or build is a classic debate in technology. Building things yourself might feel less expensive because there is no line item on your credit card bill, but

For a while, iTunes was the big dog in podcasting, so if you linked "Subscribe to Podcast" to like:

The document head might not be the most glamorous part of a website, but what goes into it is arguably just as important to the success of your website as its

There are loads of analytics platforms to help you track visitor and usage data on your sites. Perhaps most notably Google Analytics, which is widely used
