Is there any difference or any advantage of having the CSS styles in the page or in a separate external file?
I have personally found that many browsers don't properly respect STYLE attributes directly on tags, and some don't respect the <STYLE></STYLE> section in the header-- therefore, I always use css files when I'm seeking cross-browser compatibility(i.e. production sites). I use a mix when I'm doing administrative back-ends that will only be used by myself... -- Derek
Exactly, ALSO the stylesheet gets cached so as the user browses your site they don't have to wait as long for the page too load since the style is already loaded and in their cache, so that and not having to edit all files to change a few things, much easier to edit the one file as you stated. Kalina
If the css file is a little large like over 10-15k I use the include.. other than that I always use external single css file.
I would recommend never directly including CSS either in your markup or in your head section. Having CSS in external files will: Reduce your bandwidth use Allow you to make layout / style adjustments to an entire site by modifying just one file Reduce the download times for the user Allow you to manage your website better I would also recommend commenting your CSS files heavily. Some people like to keep seperate CSS files for layout and style. I don't do this but I do try to keep the two areas as discrete as possible within the file. If I have a page which has an unique layout, I create a seperate CSS file for just that page; among other things this will allow you to easily create another page with the same layout in the future. Some people think that using the conventional 'link rel' method of importing stylesheets can lead to delays in the browser applying the style information and other problems. These people tend to either use the @import with a Javascript hack or an SSI instead. Personally i've always stuck with the old way as it's never given me any problems, and newer browsers have improved their support. I've just realised that this thread is pretty old and you haven't asked for half of this info - sorry about that, just bored while my tea gets cooked for me
Here's a thought for anyone reading - I know that SE's tend to rate content more the nearer the top of the page it is. Does this only count from <body> downwards? I hope so, because if not people with the style info in their head are missing out
I agree with JaimeC, but if for no other reason than to help manage changes to your site. Modifying one file is a hell of a lot easier to do than 1,000....even if you are using some kind of WYSIWYG editor.
One file allows for easier modification as it's been mentioned before and it keeps bandwidth down because the file gets cached when the user loads the site.