<link> vs @import

Discussion in 'HTML' started by don, Mar 5, 2005.

  1. don

    don Guest

    I don't really see the difference between these two elements...... why would
    you use one and not the other?
     
    don, Mar 5, 2005
    #1
    1. Advertising

  2. don

    n|ck Guest

    don wrote:
    > I don't really see the difference between these two elements...... why would
    > you use one and not the other?


    You can control (to some degree) which browsers load your .css file using
    variations of the @import statement.
     
    n|ck, Mar 5, 2005
    #2
    1. Advertising

  3. don

    Toby Inkster Guest

    don wrote:

    > I don't really see the difference between these two elements...... why
    > would you use one and not the other?


    <link> is an HTML element. It can be used to link your HTML document to
    other URLs. These URLs can be related pages, style sheets and so forth.
    @import is a CSS "at-rule". It can be used to import external style rules.
    So <link> can be used for a whole bunch of different purposes, whereas
    @import has only one purpose.

    From a practical standpoint, @import is supported by less browsers than
    <link rel=stylesheet>, so you can use it to hide stylesheets from older
    browsers.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Mar 5, 2005
    #3
  4. in alt.html, don wrote:
    > I don't really see the difference between these two elements......


    There is lots. For example, link is html and @import is CSS.

    > why would you use one and not the other?


    If you want to import CSS from CSS, you use @import, if you want to link
    stylesheet to html page, you use link.

    You should also not that they are supported differently in browsers, but
    that is usually not problem, unless your stylesheet breaks when external
    style is not applied.

    --
    Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
    Utrecht, NL.
     
    Lauri Raittila, Mar 5, 2005
    #4
  5. don

    Richard Guest

    On Sat, 5 Mar 2005 22:38:46 +0100 Lauri Raittila wrote:

    > in alt.html, don wrote:
    >> I don't really see the difference between these two elements......

    >
    > There is lots. For example, link is html and @import is CSS.
    >
    >> why would you use one and not the other?

    >
    > If you want to import CSS from CSS, you use @import, if you want to link
    > stylesheet to html page, you use link.
    >
    > You should also not that they are supported differently in browsers, but
    > that is usually not problem, unless your stylesheet breaks when external
    > style is not applied.
    >



    Absolutely brilliant dr. watson.
    It amazes me how your feeble brain works sometimes.
     
    Richard, Mar 6, 2005
    #5
  6. don

    Nik Coughin Guest

    Re: Gross hypocrisy

    Richard wrote:
    > Absolutely brilliant dr. watson.
    > It amazes me how your feeble brain works sometimes.


    Words fail me!
     
    Nik Coughin, Mar 6, 2005
    #6
  7. don

    Andy Dingley Guest

    It was somewhere outside Barstow when "Richard" <Anonymous@127.001>
    wrote:

    >Absolutely brilliant dr. watson.
    >It amazes me how your feeble brain works sometimes.


    From most people that would be obvious sarcasm, but for you -- well,
    you really are just amazed, aren't you.
     
    Andy Dingley, Mar 6, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    902
    Kevin Spencer
    May 17, 2005
  2. Paul Opal
    Replies:
    12
    Views:
    985
    Paul Opal
    Oct 11, 2004
  3. JPractitioner
    Replies:
    13
    Views:
    20,218
    Roedy Green
    Feb 24, 2006
  4. Vitali Gontsharuk
    Replies:
    2
    Views:
    593
    Vitali Gontsharuk
    Aug 25, 2005
  5. Artur M. Piwko

    import/from import question

    Artur M. Piwko, Jun 29, 2003, in forum: Python
    Replies:
    1
    Views:
    878
    Peter Hansen
    Jul 2, 2003
Loading...

Share This Page