


The difference between imported style sheet CSS and linked style sheet CSS
1 2 3 4 5 6 7 8 |
|
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

It's out! Congrats to the Vue team for getting it done, I know it was a massive effort and a long time coming. All new docs, as well.

I'd say "website" fits better than "mobile app" but I like this framing from Max Lynch:

I had someone write in with this very legit question. Lea just blogged about how you can get valid CSS properties themselves from the browser. That's like this.

If we need to show documentation to the user directly in the WordPress editor, what is the best way to do it?

The other day, I spotted this particularly lovely bit from Corey Ginnivan’s website where a collection of cards stack on top of one another as you scroll.

There are a number of these desktop apps where the goal is showing your site at different dimensions all at the same time. So you can, for example, be writing

CSS Grid is a collection of properties designed to make layout easier than it’s ever been. Like anything, there's a bit of a learning curve, but Grid is

I see Google Fonts rolled out a new design (Tweet). Compared to the last big redesign, this feels much more iterative. I can barely tell the difference
