CSS, Style Sheet Internally or Externally ?

Reply

Join Date: Jul 2008
Posts: 10
Reputation: MeTc123 is an unknown quantity at this point 
Solved Threads: 0
MeTc123 MeTc123 is offline Offline
Newbie Poster

CSS, Style Sheet Internally or Externally ?

 
0
  #1
Sep 5th, 2008
Hello,

I'm relatively new to CSS and am interested to know if it's generally better to implement CSS internally or externally, the pro's and con's if there are any of course!
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 596
Reputation: buddylee17 has a spectacular aura about buddylee17 has a spectacular aura about 
Solved Threads: 125
buddylee17's Avatar
buddylee17 buddylee17 is offline Offline
Posting Pro

Re: CSS, Style Sheet Internally or Externally ?

 
0
  #2
Sep 5th, 2008
Externally. Why?
Let's say your site has 50 pages using the same basic styles. If your styles are internal, they'll have to be hard coded into each individual page. That means that if you visit 10 pages in the site, the styles will have to be downloaded all 10 times. If you'd have used an external stylesheet, the styles would get downloaded once, loaded into the cache, and reused for each page.
Also, if you decide to change up the style of something like your navigation bar or footer, you'll only have to change it once instead of 50 times.
Lost time is never found again.
- Benjamin Franklin
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 15
Reputation: Andrew Hucks is an unknown quantity at this point 
Solved Threads: 1
Andrew Hucks Andrew Hucks is offline Offline
Newbie Poster

Re: CSS, Style Sheet Internally or Externally ?

 
0
  #3
Sep 6th, 2008
Externally. Buddylee hit it square on the head.

For you, it'll mean much less coding. (And/or copying and pasting). If you code externally, you just need one stylesheet, where everything will be located. You can link it to all your webpages by adding a link in the <head> tags.

HTML and CSS Syntax (Toggle Plain Text)
  1. <link rel="stylesheet" type="text/css" href="css.css" />

It also helps with organization. You'll have less coding in your web pages (+1). Like said before, you'll have everything in one file.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 55
Reputation: rexibit is an unknown quantity at this point 
Solved Threads: 3
rexibit rexibit is offline Offline
Junior Poster in Training

Re: CSS, Style Sheet Internally or Externally ?

 
0
  #4
Sep 7th, 2008
As others have said, External style sheets are your best method for designing a website.

1) You don't have to edit multiple places to change styles.
2) It allows you to have pages appear differently based on which style sheet is loaded - perfect for dynamic websites.
3) Reuse your code easily.
4) Further separates your code from your presentation.
5) It's a good habit to get into based on Rule 4. You should always code once, and reuse it.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 10
Reputation: MeTc123 is an unknown quantity at this point 
Solved Threads: 0
MeTc123 MeTc123 is offline Offline
Newbie Poster

Re: CSS, Style Sheet Internally or Externally ?

 
0
  #5
Sep 8th, 2008
Hi,

Thanks guys for the feedback, I've tested both methods and i must say having separate style sheets works best not to mention all the time i save!

guess it's a no-brainer!
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 55
Reputation: MelechM is an unknown quantity at this point 
Solved Threads: 6
MelechM MelechM is offline Offline
Junior Poster in Training

Re: CSS, Style Sheet Internally or Externally ?

 
0
  #6
Sep 8th, 2008
Yeah it's faster to change something on your website, just change one file and all your pages are changed, as stated above.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC