MyBlogHelp– A Blog for Digital Marketing, Affiliate Marketing, Organic Lead Generation.
  • Home
  • About
  • Contact
  • Privacy
  • Sitemap
  • BLOG
  • AFFILIATE MARKETING
    • LeadsArk
  • MORE
    • MAKE MONEY
      • ONLINE BUSINESS
      • ADSENSE
      • AFFILIATE MARKETING
    • BLOGGING
      • SEO
      • BlogSpot
      • WORPRESS
      • GOOGLE
      • COMPUTER TIPS
    • WEB DESIGN
      • HTML
      • CSS
      • BOOTSTRAP
      • JAVASCRIPT
      • JQUERY
    • WEB DESIGN
      • HTML
      • CSS
      • BOOTSTRAP
      • JAVASCRIPT
      • JQUERY
    • WEB DEVELOPMENT
      • PHP
      • WORDPRESS
  • DOWNLOADS
    • Blogger Template
    • Wordpress Theme
    • PDF

Sunday, May 12, 2019

How to use css @import rule? CSS Tutorial 26

 MyBlogHelp     May 12, 2019     css     40 comments   

css @import rule

 

  CSS @import Rule

  1. Introduction to CSS @ import rule
  2. Syntax of CSS @ import rule
  3. Values of CSS @ import rule

Introduction to CSS @import Rule

CSS styles can be defined in many ways for any HTML page. For example, you can also define CSS style inside the HTML file or you can define all the styles in it by creating an external file.

When you create a large web application, it defines a lot of CSS styles to design. If you define these styles within the HTML file then it is so much that you can not manage them. 

Because when you define CSS inside the HTML file, it is not categorized. Whenever you need to make any changes, then you have to search the entire HTML file.

In addition, when you define a lot of CSS styles in the HTML file, it also affects the loading speed of the page. In these situations, the @import rule has been introduced in CSS.

You can import CSS styles from other style sheets via CSS @import rule. A stylesheet is a file that contains many defined CSS styles. A style sheet is saved with the .css extension.  

You can also include an external stylesheet in the webpage by using the <link> tag. When you use the <link> tag, it is allowed parallel loading. That means more than one stylesheet can load simultaneously.

But when you use the @import rule, parallel loading is not allowed. This means that if you import more than one stylesheet into an HTML file, the loading of the second stylesheet will not start until the first stylesheet loads completely.

You can also define media type (Computer, laptop, mobile, etc.) with CSS @import rule. That is, you can define that the style sheet to be imported, which type of media type will apply.

In addition to the media type you can also define complete media query with this rule. Media types can also define in <link> tag.

The use of CSS @import rule is very less. However, this rule is very useful in many situations. For example, Unless there is a special stylesheet load, the rest of the stylesheets are not loaded, you can use it for it.

Syntax of CSS @import Rule

The general syntax of the CSS @import rule has been given below.

@import url ("url-of-stylesheet-here");

If you do not want to define the URL () function, you can also directly define the URL as a single string as well.

@import url-of-stylesheet-here;

Media type or media query can also be defined with a @import rule. These are defined at the end of the URL.

@import url ("url-of-stylesheet-here") media-type / media-query; 

For more information regarding media types and media queries, you can read the @media rule tutorial.

Example of CSS @import Rule

A simple example of CSS @import rule has been given below.

mbhWebPage.html


<!DOCTYPE html>
<html>
<head>
 <title> CSS @import Rule Example </title>
<style>
@import url("mbh.css");
</style>
</head>
<body>
<h1> MyBlogHelp </h1>
<p>MyBlogHelp is a website where articles are shared like Blogging, SEO, Web Design, Web Development, HTML, CSS and Computer related all Tips.</p> 
</body>
</html>


mbh.css

body{
width: 30%;
}
h1
{
    color: red;
    font-size: 50px;
    font-weight: bold;
    margin: 30px
 }
p
{
    color: blue;
    font-size: 25px;
    font-weight: bold;
    font-style: oblique;
}


This example will give the below output.


@import-rule-example



       <<-- PREVIOUS                                                                                                  NEXT -->>





  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

40 comments:

  1. AnonymousMay 12, 2019 at 11:40 AM

    Hey! This post could not be written any better! Reading through
    this post reminds me of my good old room mate! He always kept chatting about
    this. I will forward this write-up to him. Pretty sure
    he will have a good read. Thank you for sharing!

    ReplyDelete
    Replies
      Reply
  2. AnonymousMay 29, 2019 at 1:44 AM

    Good post.Never knew this, regards for letting me know.

    ReplyDelete
    Replies
      Reply
  3. AnonymousJune 5, 2019 at 5:18 AM

    I definitely wanted to send a simple remark to thank you for
    these great steps you are writing on this site. My time intensive internet search has at the end of the day been rewarded with wonderful knowledge to go over with my close friends.
    I 'd suppose that many of us website visitors actually are unquestionably blessed
    to exist in a good site with very many lovely people with good advice.
    I feel extremely lucky to have discovered your web pages and
    look forward to many more fun moments reading here.
    Thanks again for everything.

    ReplyDelete
    Replies
      Reply
  4. AnonymousJune 6, 2019 at 6:51 PM

    It's not my first time to go to see this website, i am visiting this web
    site dailly and get good information from here daily.

    ReplyDelete
    Replies
      Reply
  5. AnonymousJune 6, 2019 at 7:57 PM

    I was able to find good information from your articles.

    ReplyDelete
    Replies
      Reply
  6. AnonymousJune 6, 2019 at 9:13 PM

    It's an amazing paragraph for all the web viewers; they will get benefit from it
    I am sure.

    ReplyDelete
    Replies
      Reply
  7. AnonymousJune 7, 2019 at 9:46 AM

    What's up, everything is going fine here and ofcourse every one is
    sharing data, that's really excellent, keep up writing.

    ReplyDelete
    Replies
      Reply
  8. AnonymousJune 7, 2019 at 11:17 AM

    It's difficult to find knowledgeable people in this particular
    subject, but you sound like you know what you're talking about!
    Thanks

    ReplyDelete
    Replies
      Reply
  9. AnonymousJune 7, 2019 at 4:16 PM

    I don't ordinarily comment but I gotta state thank you for the
    post on this special one :D.

    ReplyDelete
    Replies
      Reply
  10. AnonymousJune 7, 2019 at 6:42 PM

    hello!,I like your writing so much! percentage we communicate
    more approximately your article on AOL? I need a
    specialist on this space to resolve my problem. May be that is you!

    Having a look forward to peer you.

    ReplyDelete
    Replies
      Reply
  11. AnonymousJune 8, 2019 at 2:59 AM

    I really like what you guys tend to be up too.
    This type of clever work and reporting! Keep up the very good works guys
    I've included you guys to our blogroll.

    ReplyDelete
    Replies
      Reply
  12. AnonymousJune 8, 2019 at 4:28 PM

    Wohh precisely what I was looking for, regards for putting up.

    ReplyDelete
    Replies
      Reply
  13. AnonymousJune 9, 2019 at 11:55 AM

    Hi there i am kavin, its my first time to commenting anyplace,
    when i read this piece of writing i thought i could also make comment
    due to this brilliant piece of writing.

    ReplyDelete
    Replies
      Reply
  14. AnonymousJune 9, 2019 at 4:27 PM

    Wow, that's what I was exploring for, what a information! existing here
    at this web site, thanks admin of this site.

    ReplyDelete
    Replies
      Reply
  15. AnonymousJune 9, 2019 at 6:12 PM

    I visited several websites but the audio quality for audio songs current at this web site
    is in fact superb.

    ReplyDelete
    Replies
      Reply
  16. AnonymousJune 10, 2019 at 6:44 PM

    I was just looking for this info for a while. After six hours of continuous Googleing, finally I got it in your site.
    I wonder what is the lack of Google strategy that do not rank this type
    of informative sites in top of the list. Generally the top web sites
    are full of garbage.

    ReplyDelete
    Replies
      Reply
  17. AnonymousJune 15, 2019 at 10:44 PM

    Every weekend i used to pay a quick visit this
    site, because i want enjoyment, as this this web
    page conations genuinely fastidious funny stuff
    too.

    ReplyDelete
    Replies
      Reply
  18. AnonymousJune 17, 2019 at 2:02 PM

    I went over this internet site and I believe you have a
    lot of excellent information, bookmarked (:.

    ReplyDelete
    Replies
      Reply
  19. AnonymousJune 20, 2019 at 3:00 AM

    I went over this website and I conceive you have a lot
    of fantastic information, saved to my bookmarks (:.

    ReplyDelete
    Replies
      Reply
  20. AnonymousJune 23, 2019 at 9:25 PM

    I am no longer positive where you are getting your information, however great topic.
    I must spend some time learning much more or understanding
    more. Thanks for wonderful info I used to be on the lookout for
    this info for my mission.

    ReplyDelete
    Replies
      Reply
  21. AnonymousJune 23, 2019 at 10:41 PM

    F*ckin' amazing things here. I am very satisfied
    to see your article. Thank you a lot and i'm having a look forward to contact
    you. Will you please drop me a e-mail?

    ReplyDelete
    Replies
      Reply
  22. AnonymousJune 24, 2019 at 5:12 AM

    Really good visual appeal on this website, I'd rate it 10.

    ReplyDelete
    Replies
      Reply
  23. AnonymousJune 24, 2019 at 5:14 PM

    I have been exploring for a little bit for any high quality
    articles or blog posts in this kind of space .
    Exploring in Yahoo I eventually stumbled upon this website.
    Studying this info So i'm glad to show that I've
    a very just right uncanny feeling I came upon exactly what I needed.
    I so much undoubtedly will make certain to don't disregard this site and give it a
    glance on a continuing basis.

    ReplyDelete
    Replies
      Reply
  24. AnonymousJune 25, 2019 at 12:27 PM

    Great post however I was wanting to know if you could write a litte more on this topic?

    I'd be very thankful if you could elaborate a little bit further.
    Thanks!

    ReplyDelete
    Replies
      Reply
  25. AnonymousJune 26, 2019 at 2:41 PM

    Spot on with this write-up, I honestly feel this website
    needs a great deal more attention. I'll probably be returning to read through
    more, thanks for the info!

    ReplyDelete
    Replies
      Reply
  26. AnonymousJune 27, 2019 at 8:43 AM

    Hi there, I found your web site by means of Google
    even as searching for a related matter, your site came up, it seems great.
    I've bookmarked it in my google bookmarks.[X-N-E-W-L-I-N-S-P-I-N-X]Hi there, simply turned into alert to your weblog through Google,
    and located that it's truly informative. I'm going to be careful for brussels.
    I will appreciate when you proceed this in future.
    Many other folks will probably be benefited out of your writing.

    Cheers!

    ReplyDelete
    Replies
      Reply
  27. AnonymousJune 30, 2019 at 5:48 AM

    Hi! This post could not be written any better! Reading this post reminds me
    of my old room mate! He always kept talking about this.
    I will forward this write-up to him. Pretty sure he will have a good read.
    Many thanks for sharing!

    ReplyDelete
    Replies
      Reply
  28. AnonymousJune 30, 2019 at 7:47 AM

    Undeniably consider that which you stated. Your favorite reason appeared to be
    at the net the simplest thing to take into account of.
    I say to you, I certainly get irked at the same time
    as other people think about concerns that they just do not know about.
    You controlled to hit the nail upon the highest and
    defined out the entire thing with no need side-effects , other folks can take a signal.
    Will likely be back to get more. Thanks

    ReplyDelete
    Replies
      Reply
  29. AnonymousJuly 7, 2019 at 1:46 AM

    You completed various nice points there. I did a search on the theme and found nearly all persons will have the same opinion with your blog.

    ReplyDelete
    Replies
      Reply
  30. AnonymousJuly 16, 2019 at 2:32 AM

    I really like looking through an article that can make men and women think.
    Also, many thanks for permitting me to comment!

    ReplyDelete
    Replies
      Reply
  31. AnonymousJuly 18, 2019 at 4:38 PM

    Hello, Neat post. There is an issue with your site in web
    explorer, might test this? IE still is the marketplace leader and a huge element of folks
    will leave out your excellent writing because of this problem.

    ReplyDelete
    Replies
      Reply
  32. AnonymousJuly 20, 2019 at 9:38 PM

    Wow, wonderful weblog format! How long have you ever been blogging for?
    you make running a blog look easy. The entire look of your web site is magnificent, as smartly as the content material![X-N-E-W-L-I-N-S-P-I-N-X]I simply
    couldn't depart your web site before suggesting that I really enjoyed the usual information a person provide for
    your visitors? Is gonna be again continuously to investigate cross-check new posts.

    ReplyDelete
    Replies
      Reply
  33. AnonymousJuly 22, 2019 at 1:55 AM

    When someone writes an paragraph he/she keeps the idea
    of a user in his/her mind that how a user can be aware
    of it. So that's why this post is perfect. Thanks!

    ReplyDelete
    Replies
      Reply
  34. AnonymousJuly 27, 2019 at 10:55 AM

    This paragraph will help the internet users for building up new weblog
    or even a blog from start to end.

    ReplyDelete
    Replies
      Reply
  35. AnonymousAugust 6, 2019 at 9:49 AM

    Wow, marvelous weblog structure! How lengthy have you been running
    a blog for? you make running a blog look easy.
    The total glance of your website is wonderful, let alone the content material![X-N-E-W-L-I-N-S-P-I-N-X]I
    just couldn't leave your website prior to suggesting that
    I really loved the usual info an individual supply to your guests?
    Is gonna be back ceaselessly to check out new posts.

    ReplyDelete
    Replies
      Reply
  36. AnonymousAugust 6, 2019 at 12:14 PM

    Everything is very open with a clear description of the challenges.
    It was really informative. Your website is useful.
    Many thanks for sharing!

    ReplyDelete
    Replies
      Reply
  37. AnonymousAugust 21, 2019 at 6:48 PM

    Hey there would you mind letting me know which webhost you're working with?
    I've loaded your blog in 3 completely different web browsers and I
    must say this blog loads a lot quicker then most.
    Can you suggest a good hosting provider at a
    honest price? Kudos, I appreciate it!

    ReplyDelete
    Replies
      Reply
  38. AnonymousAugust 22, 2019 at 1:48 PM

    I have been absent for a while, but now I remember why I used to love
    this website. Thank you, I will try and check back more
    frequently. How frequently you update your web site?

    ReplyDelete
    Replies
      Reply
  39. AnonymousAugust 26, 2019 at 10:39 AM

    Right away I am going to do my breakfast, after having my breakfast coming yet again to read more news.

    ReplyDelete
    Replies
      Reply
  40. AnonymousAugust 27, 2019 at 12:12 PM

    Right away I am going to do my breakfast, after having my breakfast coming again to read additional news.

    ReplyDelete
    Replies
      Reply
Add comment
Load more...

Thank you for reading this post. Please do not enter any spam link in the comment box.

Followers

Blog Archive

  • ►  2020 (4)
    • ►  October (1)
    • ►  September (1)
    • ►  August (2)
  • ▼  2019 (52)
    • ►  December (1)
    • ►  November (2)
    • ►  October (1)
    • ►  August (1)
    • ►  July (1)
    • ▼  May (11)
      • How to use css transition property? CSS Tutorial 29
      • How to use css transform property? CSS Tutorial 30
      • How to use css object-fit property? CSS Tutorial 28
      • How to use css filter property? CSS Tutorial 27
      • How to use css @import rule? CSS Tutorial 26
      • How to use css @media query? CSS Tutorial 25
      • How to use css @font-face rule? CSS Tutorial24
      • How to use css text shadow property? CSS Tutorial 23
      • How to use css border-image property? CSS Tutorial 22
      • How to use css pseudo elements? CSS Tutorial 21
      • How to use pseudo class selectors? CSS Tutorial 20
    • ►  April (10)
    • ►  March (6)
    • ►  February (3)
    • ►  January (16)
  • ►  2018 (54)
    • ►  December (27)
    • ►  November (5)
    • ►  May (5)
    • ►  April (4)
    • ►  February (3)
    • ►  January (10)
  • ►  2017 (17)
    • ►  December (9)
    • ►  November (8)

Popular Posts

  • How to use the main tag in html5?
  • How to use keygen tag in html5?
  • How to use html5 mark tag to highlight text?
  • How to start Online Business without money from home?
  • What is a search engine?

Contact Us

Name

Email *

Message *

About MyBlogHelp

Most of the posts, we share on this blog related to Affiliate Marketing, Organic Lead Generation, Digital Marketing, Social Media Marketing, Make Money Online, SEO, and web design.

Featured Post

LeadArk - Affiliate Marketing | Qualified Organic Lead Generation | LeadsArk Review

Copyright © MyBlogHelp– A Blog for Digital Marketing, Affiliate Marketing, Organic Lead Generation.
Design by Md. Abdussamad | MyBlogHelp.com