Contact Number

+919501010103

Email Address

contact@oxosolutions.com

OXO Solutions®
  • Cables & Accessories
  • CPU
  • Motherboards
  • Networking
  • Power Supply
  • RAID Controllers
  • RAM
  • Server Cabinets
  • Storage
  • Shop
  • My account

How to Avoid CSS@import? What is it and Why is Required?

How to avoid CSS@import? What is it and Why is Required-oxo-solution-digital-marketing-sompany

Cascading style sheets (CSS) is a style sheet language which is used to describe the look and formatting of the web page. 

What is CSS@import?

It is a process of importing CSS file into another CSS file. It is an external stylesheet. Here is the example of CSS@import.

<style>

@import url(B.css) ;

</style>

Why avoid CSS@import?

It causes additional HTTP requests for server and browser which increases the page load time. 

The delay in page load occurs because the files are downloaded in a sequential manner (this means one after the other) instead of downloading parallelly. The sequential loading adds additional round trip times to the overall page and thus slows down the web page as per the number of CSS files imported. 

Positions of CSS@import?

CSS @ import can be added in both CSS files and HTML pages. 

  • Usage in CSS files
    • It can be located at the top of the page. Here is the example of the script:
@import url(“style2.css”)

  • Usage in HTML files
    • It is used in the style tags. Here is an example:
<style type=”text/css”>

@import url(“style2.css”);

font-family: sans serif;

font-size: 17px;

font-weight: 300;

# more CSS scripts #

</style>

You may also like to read:- How You Can Make Money with eCommerce Website


How to avoid CSS@import?

This problem can be fixed using one of three methods:

#Method 1: By combining CSS files

 One method is that you can merge the files. This means you can simply copy and paste the files you were importing, directly into the original file. This will remove the need to import the file. 

Another way is that you can add a separate link in the header of HTML instead of adding CSS@import. 

#Method 2: By using inline CSS in HTML

If the CSS is inlined in the HTML, this reduces the unnecessary sequential loading of the page. 

<img src="picture.jpg" /><script type=“text/css”>…CSS script goes here…</script>

#Method 3: By using link tag in the HTML

If the link tag is used in the header of HTML instead of using CSS@import, this also helps in reducing the problem. 

<link href=”style2.css” rel=” stylesheet” type=”text/css”>

Conclusion

This article explains why CSS@import is bad for the page speed, including the additional steps that are added for the browser to load the web page. Moreover, it causes the browser to download, parse and then go out and get the next CSS file before it starts displaying the page.  

The best practice is to use not even a single @import.

Post navigation

Previous
Next

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

About

At OXO Solutions, we are committed to providing high-quality server hardware and IT components for businesses and individuals.
With years of experience in IT infrastructure and web solutions, we understand the importance of reliable hardware. Our goal is to deliver powerful, scalable, and cost-effective solutions that help businesses grow. We offer everything from individual components like RAM and hard drives to fully configured servers ready for deployment.

About

Pages

  • Home
  • About
  • Shop
  • Cart
  • Checkout
  • Privacy Policy
  • Blog
  • Contact

Contact Number

Email Address

Address

©2026 OXO Solutions®. All rights reserved.

Copyright Right
  • Privacy Policy
  • Terms and Conditions