how CSS is referenced within the page.

This is a discussion on "how CSS is referenced within the page." within the Web Page Design section. This forum, and the thread "how CSS is referenced within the page. are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 16th, 2007, 10:57
SuperMember

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
how CSS is referenced within the page.

I have seen some CSS implemented on a page in the following way.
<style type="text/css">
@import url(/css/style.css);
</style>


I thought the way to implement CSS was using the following text
<link rel="stylesheet" type="text/css" href="/css/style.css" />

Why would you use the first method ( @import url(/css/style.css);
)?
are there adavatages to ussing this method?
does it help in SEO?


Also in some cases I have seen both methods used, one for the scree css and the other for the print css. I am a little confused.
Reply With Quote

  #2 (permalink)  
Old Nov 16th, 2007, 11:17
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how CSS is referenced within the page.

Quote:
Originally Posted by parms View Post
Why would you use the first method ( @import url(/css/style.css);
)?
are there adavatages to ussing this method?
does it help in SEO?
@import is normally used to hide CSS from very old browsers. This is pointless nowadays.

It's supposed to be used to "import" styles from other stylesheets, allowing you to combine multiple stylesheets. Check out what the W3C say. <link>ed styles will take precedence over @import.

Basically, you should ignore @import and use <link> instead. There are no advantages of @import, except for websites that need complicated style cascading rules.

Last edited by MikeHopley; Nov 16th, 2007 at 11:19.
Reply With Quote
  #3 (permalink)  
Old Nov 16th, 2007, 11:24
SuperMember

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how CSS is referenced within the page.

"Basically, you should ignore @import and use <link> instead. There are no advantages of @import, except for websites that need complicated style cascading rules."

What would be regaded as
complicated style cascading rules?
Reply With Quote
  #4 (permalink)  
Old Nov 16th, 2007, 12:03
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how CSS is referenced within the page.

Quote:
Originally Posted by parms View Post
"Basically, you should ignore @import and use <link> instead. There are no advantages of @import, except for websites that need complicated style cascading rules."

What would be regaded as
complicated style cascading rules?
A global corporate web-portal that uses a combination of company-wide styles (the <link>ed styles) and local variations (the @import). In theory, this could allow a company to maintain control over "house style", while permitting local web masters some degree of freedom in their own stylesheets.

Basically, nothing you're ever likely to do.
Reply With Quote
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Green bar of colour at bottom of page gets bigger the more page is extended pixelgirl Web Page Design 1 Apr 1st, 2008 01:27
internal navigation, Linking from one page to a specific div in another page. Oak Web Page Design 5 Feb 8th, 2008 22:54
can't go to any other page until my page is completly loaded khwabsheth JavaScript Forum 2 Nov 7th, 2007 00:48
Linking an outside page back to previous framed page MJustison Starting Out 1 Oct 18th, 2007 17:49
A gap appears beween the Page Title and the Body Content of the page. sovereign6 Web Page Design 6 Dec 18th, 2006 19:14


All times are GMT. The time now is 21:58.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43