Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

HTML - <link> vs @import

 
Thread Tools Search this Thread
Old 03-05-2005, 09:18 PM   #1
Default <link> vs @import


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




don
  Reply With Quote
Old 03-05-2005, 09:22 PM   #2
n|ck
 
Posts: n/a
Default Re: <link> vs @import

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.
  Reply With Quote
Old 03-05-2005, 09:33 PM   #3
Toby Inkster
 
Posts: n/a
Default Re: <link> vs @import

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

  Reply With Quote
Old 03-05-2005, 09:38 PM   #4
Lauri Raittila
 
Posts: n/a
Default Re: <link> vs @import

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.
  Reply With Quote
Old 03-06-2005, 12:34 AM   #5
Richard
 
Posts: n/a
Default Re: <link> vs @import

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.


  Reply With Quote
Old 03-06-2005, 01:02 AM   #6
Nik Coughin
 
Posts: n/a
Default Re: Gross hypocrisy

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


Words fail me!


  Reply With Quote
Old 03-06-2005, 12:06 PM   #7
Andy Dingley
 
Posts: n/a
Default Re: <link> vs @import

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.

  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump