Old 24-06-2007, 11:41   #1 (permalink)
shaftb
Senior Member
 
shaftb's Avatar
 
Join Date: Jul 2006
Location: Midwest
Posts: 337
Send a message via AIM to shaftb
External Style Sheet for CSS?

What is the best practice for CSS?
I see on W3Schools.com they always have the CSS right in the HTML. But using other things, I see to link an external style sheet.
In your opinion..what is the best, safest, cleanest way to do it.

Thanks!
__________________
Daughter of Aphrodite-Hear my words and take Heed-I was born on Olympus-To my father a Son-I was raised by the demons-Trained to reign as the One.
  Reply With Quote
Old 24-06-2007, 11:52   #2 (permalink)
Limbo
Baskin'
 
Join Date: Feb 2005
Posts: 5,619
Go external - one for screen, one for print.

Makes no sense to have it embeded in the page (unless you are using server includes).
  Reply With Quote
Old 24-06-2007, 12:51   #3 (permalink)
5P4C3
Deathblow
 
5P4C3's Avatar
 
Join Date: Apr 2006
Location: Norway
Posts: 354
External stylesheet!
__________________
  Reply With Quote
Old 24-06-2007, 14:13   #4 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
External, always. I generally have 4 for screen (2 are IE-only), 1 for print, 1 for mobile.
  Reply With Quote
Old 25-06-2007, 01:19   #5 (permalink)
fivel
Keithics
 
fivel's Avatar
 
Join Date: May 2006
Posts: 20
Send a message via MSN to fivel Send a message via Yahoo to fivel Send a message via Skype™ to fivel
external,

You can in W3Schools that they are embedding it because for learning sake.. coz it's easy for beginners to learn.

But sometimes you have no choice but to embed it ..
  Reply With Quote
Old 25-06-2007, 03:37   #6 (permalink)
Jayx
Now with added sarcasm.
 
Jayx's Avatar
 
Join Date: Aug 2006
Location: George, South Africa
Posts: 351
Send a message via MSN to Jayx Send a message via Skype™ to Jayx
Almost always external.
__________________
I made 100 posts and all I got is this stupid signature.
  Reply With Quote
Old 25-06-2007, 10:43   #7 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
If you put your styles on every page you're just making your users download it every time they want to view a page. In terms of bandwidth, it's kind of wasteful, isn't it?

External styles are cached.
  Reply With Quote
Old 25-06-2007, 12:18   #8 (permalink)
twentysixtwelve
css is cool m'kay
 
twentysixtwelve's Avatar
 
Join Date: Mar 2007
Location: Currently Vancouver, Canada
Posts: 385
always external. Except if you`re doing an html newsletter... but thats a completely different kettle of cod.
  Reply With Quote
Old 25-06-2007, 12:51   #9 (permalink)
Jonas
Registered User
 
Join Date: Jun 2007
Location: Denmark
Posts: 66
At Alistapart.com you can find an article called "Alternative Style: Working With Alternate Style Sheets"

That's a very good introduction how to organize CSS.
  Reply With Quote
Old 26-06-2007, 08:05   #10 (permalink)
ivan11
Registered User
 
Join Date: Jun 2007
Posts: 10
internal css is much quicker to load
  Reply With Quote
Old 26-06-2007, 08:13   #11 (permalink)
Bill Posters
trouble free and loverlee
 
Join Date: Mar 2003
Location: YooKay
Posts: 2,933
Quote:
internal css is much quicker to load
Nonsense.

Assuming they both start at the same point in the markup, embedded css loads no quicker than external css.
The main speed difference kicks in on subsequent pages which use the same external stylesheet.
Whereas embedded css will need to be read in on every new page which uses it, external stylesheets are cached by the browser, so will not be re-read by the browser, reducing load-time on all subsequent pages.
  Reply With Quote
Old 26-06-2007, 08:17   #12 (permalink)
twentysixtwelve
css is cool m'kay
 
twentysixtwelve's Avatar
 
Join Date: Mar 2007
Location: Currently Vancouver, Canada
Posts: 385
Quote:
Originally Posted by ivan11
internal css is much quicker to load
Silly thing to say...
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8