<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. Advertisements

  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. Advertisements

  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. Advertisements

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. Paul Opal
    Replies:
    12
    Views:
    1,217
    Paul Opal
    Oct 11, 2004
  2. JPractitioner
    Replies:
    13
    Views:
    20,599
    Roedy Green
    Feb 24, 2006
  3. Vitali Gontsharuk
    Replies:
    2
    Views:
    752
    Vitali Gontsharuk
    Aug 25, 2005
  4. Artur M. Piwko

    import/from import question

    Artur M. Piwko, Jun 29, 2003, in forum: Python
    Replies:
    1
    Views:
    1,035
    Peter Hansen
    Jul 2, 2003
  5. Dennis
    Replies:
    2
    Views:
    675
    Dennis
    Aug 18, 2003
  6. Pierre Rouleau
    Replies:
    4
    Views:
    1,045
    Pierre Rouleau
    Mar 7, 2004
  7. Andrew James
    Replies:
    1
    Views:
    1,167
    Diez B. Roggisch
    Dec 4, 2004
  8. Torsten Mohr

    import hook, overwrite import?

    Torsten Mohr, Jan 26, 2005, in forum: Python
    Replies:
    2
    Views:
    577
    Steve Holden
    Jan 27, 2005
Loading...