1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

@import is a good practice?

Discussion in 'Web Design, HTML And CSS' started by johnny.dacu, Jul 26, 2010.

  1. johnny.dacu

    johnny.dacu New Member

    Joined:
    Jul 6, 2010
    Messages:
    88
    Likes Received:
    4
    Trophy Points:
    0
    I know that one technique is to include some css files on main one with @import.
    Isn't this a bad practice? Because with @import browser still makes the request, and if the main is blank then you could endup with n+1 requests.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,285
    Likes Received:
    364
    Trophy Points:
    83
    Could not get you. Do you mean other ways of doing apart from import would mean it will not do the request?
     
  3. johnny.dacu

    johnny.dacu New Member

    Joined:
    Jul 6, 2010
    Messages:
    88
    Likes Received:
    4
    Trophy Points:
    0
    It was a question... I just said (but i'm waiting for someone to tell me is i'm right): when you have three css files and use anoter one to import all of them, this will endup with 4 requests (main plus other three) or is just the main (1 request)
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,285
    Likes Received:
    364
    Trophy Points:
    83
    The total number of requests would be same as number of files.
     

Share This Page