PDA

View Full Version : CSS (External vs Internal)


spazzer
08-24-2009, 09:03 AM
Hi All,
Can anyone help as I am alittle confused !, I am trying to design a simple website with about 10 pages, I am designing a page to use as a template for all the pages of the site, I understand that with CSS if I apply a style to the page only that style will only be used on that page, and if I attach the style to an external style sheet that stle sheet can then be attached to all pages in the website to give a uniform look to the site !
My question is if I am designing a template and use the template for the other pages will all the styles be copied with it and if so why is there the need for the external style sheet ?, if I change say a colour for the background in the original template will all the pages that have been designed with the template also change the background ?
Can someone explain to me how to do this and also why it is done in this way ?

any help would be appreciated,
Thanks NC :grin:

edbr
08-24-2009, 09:07 AM
yes you are ight . the point is having an external css when you make changes to style it requires i file to be updated uploaded. keeping the styles in the template means that all files will need to be updated and uploaded.
the bigger the site the bigger that effort becomes of course

Corrosive
08-24-2009, 11:47 AM
Use an external stylesheet. No question ;)

DWcourse
08-24-2009, 01:17 PM
Plus an external style sheet will be cached by the browser so download times will improve. Also there might be some minor SEO benefits to having the style sheet external.

spazzer
08-24-2009, 04:51 PM
Hi,
So are you saying all my css should be placed into an external style sheet !, then attached to the template, does every page created with the template need to be attached to the external style sheet or is it that because the template is attached to the external style sheet and the pages are created using the template that the style sheet just needs updating once then all the pages in the site will be updated ???

Cheers,
Nick C;-)

DWcourse
08-24-2009, 05:25 PM
Yes, if the style sheet is attached to the template, the pages created from the template will also have the style sheet attached.