PDA

View Full Version : HTML includes CSS and JScript or Use seperate files?



effpeetee
Sep 5th, 2007, 11:34 AM
I know that in general it is accepted that one uses seperate files for the CSS HTML and JScript etc. BUT where the CSS and JScript applies to only one HTML page. Is there any reason why they should not be combined in one HTML page.

For me, it makes editing much easier. And, there are two less files to upload!

Frank

ahallicks
Sep 5th, 2007, 01:21 PM
In my opinion, if you only use one style on one page, or one piece of script on one page then I see no reason why you shouldn't just stick it in that page alone. This includes inline styles aswell. If you have one element that you need moving slightly differently, use an inline style on it. It's not wrong and it is easier to control for that page. Most of the sites I create tend to use one external stylesheet (sometimes an IE style too) so all of the pages use the same styles, which is easiest to have one external stylesheet. But on the odd occasion I will have one page that has something new and unique so I'll stick a style in the header for that page only. There is nothing wrong with it and if it makes sense, then go for it!

effpeetee
Sep 5th, 2007, 01:31 PM
In my opinion, if you only use one style on one page, or one piece of script on one page then I see no reason why you shouldn't just stick it in that page alone. This includes inline styles aswell. If you have one element that you need moving slightly differently, use an inline style on it. It's not wrong and it is easier to control for that page. Most of the sites I create tend to use one external stylesheet (sometimes an IE style too) so all of the pages use the same styles, which is easiest to have one external stylesheet. But on the odd occasion I will have one page that has something new and unique so I'll stick a style in the header for that page only. There is nothing wrong with it and if it makes sense, then go for it!
Thank you ahallicks,

It also makes sense to me too. That's what I shall do.

Regards,

Frank

felgall
Sep 6th, 2007, 08:00 AM
Of course puting them in a separate file will slow things down (three files instead of one to download) and also make the page slightly less search engine friendly (less content and more non content). So it would depend on the size of the CSS and JavaScript sections.

effpeetee
Sep 6th, 2007, 11:08 AM
Of course puting them in a separate file will slow things down (three files instead of one to download) and also make the page slightly less search engine friendly (less content and more non content). So it would depend on the size of the CSS and JavaScript sections.
Yes Stephen, it's "Horses for courses"

I had in mind the speed as well, but I have so many files on my ISP, that I really do want to find ways to reduce them. That is why I had another post on hyperlinking to an image which itself had been selected by a hyperlink.

At present, I have a program that hyperlinks a thumbnail to it;s parent image from a selection page. I wanted to then click the full image and go back to the selection page. I managed to do this with a random image by hyperlinking the container div. If I could find some way to do this with the above jpegs, I could get rid of over two hundred HTML pages from my site.

Still trying.

Frank