0

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!

5
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by MelechM
0

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.

0

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.

<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.

0

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.

0

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!

0

Yeah it's faster to change something on your website, just change one file and all your pages are changed, as stated above.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.