navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Difference between <link> and @import

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> Difference between <link> and @import
Page: [1]
 
lilblackgirl

 

Posts: 288
Joined: 5/16/2002
From:
Status: offline

 
Difference between <link> and @import - 3/24/2004 13:49:36   
What's the difference and why would i use one over the other?


And i've gotten pretty noisy around here lately, so i'll keep my yap shut for a while.

< Message edited by lilblackgirl -- 3/24/2004 13:18:42 >
gorilla

 

Posts: 2974
From: Denmark
Status: offline

 
RE: Difference between <link> and @import - 3/24/2004 14:39:54   
They're both ways of telling a browser where to find the stylesheet. The main advantage to @import is that you can use the link method to set up very basic css understood by primitive browsers with bad css support such as nn4.78 then use @import for the more sophisticated stuff. Version 4 browsers don't understand @import so they ignore it completely. Think of it as one way of browser sniffing.

You might like to look here:

http://www.frontpagewebmaster.com/m-165257/tm.htm

This posting was done by a colleague while I was in hospital. He explains it very well I think.

The hell you'll shut your yap unless it means you're off making what you learned in theory work in practice. How else do you think you'll learn to master css?

_____________________________

Mháircaish

Signature self-censored to protect the sensibilities of the thin-skinned :).

May we never confuse honest dissent with disloyal subversion. – Dwight D. Eisenhower



(in reply to lilblackgirl)
gorilla

 

Posts: 2974
From: Denmark
Status: offline

 
RE: Difference between <link> and @import - 3/24/2004 14:50:04   
Ah it was done by Jesper - he had a very unique voice - damnit I really miss Jesper.

_____________________________

Mháircaish

Signature self-censored to protect the sensibilities of the thin-skinned :).

May we never confuse honest dissent with disloyal subversion. – Dwight D. Eisenhower



(in reply to gorilla)
d a v e

 

Posts: 4177
Joined: 7/24/2002
From: England (but live in Finland now)
Status: offline

 
RE: Difference between <link> and @import - 3/24/2004 14:58:10   
another useful thing about import is using it to append styles to a global style sheet
for examaple if you have a university website all departments sharing a global style sheet for the look of all the pages, but the departments that are in the student services want a modified look (say they want all their headings in blue and not green like the rest of the uni, but body text and all the other stlyes to be the same) then you can import 2 stylesheets, the main uni one first and then the second one right after conatinaing the styles that are different

@import url("UniMain.css");
@import url(".studentservices.css")

heading one is green (default uni style)in the first style sheet and blue (student services style) in the second, and because of the cascade the second rule for H1 wins out and the headings are blue
obviously you ONLY import BOTH sheets into the student services pages, the other uni pages have just the first sheet )

< Message edited by d a v e -- 3/25/2004 3:02:27 >


_____________________________

David Prescott
Gekko web design

(in reply to gorilla)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> Difference between <link> and @import
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts