Where to keep css files?

J

Jim Scott

On my site which is mainly images, I keep my images in a separate folder,
mainly because it makes them easier for me to find. Every .htm/.html page
uses two css files.
Does it make any difference to loading speed whether I store the css files
with the images ot in the main site?
It may not matter, but I noticed the Nvu stores all files other then .htmls
together and I wondered if there is a good reason for this.
 
R

Roy Schestowitz

__/ [Jim Scott] on Monday 29 August 2005 15:00 \__
On my site which is mainly images, I keep my images in a separate folder,
mainly because it makes them easier for me to find.


That's a good thing. When you have too many images, consider subdirectories,
but _DO NOT_ move existing images from ~/img. Crawlers index them and
refresh their indices for images very, very infrequently. Consider adding
new files in subsubdirectories too (see reason below[1]).

Every .htm/.html page
uses two css files.
Does it make any difference to loading speed whether I store the css files
with the images ot in the main site?


The performance penalty would be merely proportional to putting an extra
straw on a camel's back.


Put CSS files in ~/css. It would give you to better room to expand while
remaining tidy. It also would make your source code more elegant.

It may not matter, but I noticed the Nvu stores all files other then
.htmls together and I wondered if there is a good reason for this.


Maybe historical reasons should be considered here. My site is quite messy
due to changes in scale that occurred through the years. If it weren't for
crawlers (or laziness), changes would have been made. I am sure that even
the largest businesses started small too.

[1]If you view or list files in a directory with thousands of files, loading
time can be horribly affected. There are more issues to consider like
naming collisions, extensibility and so forth.

Roy
 
M

Morgan

Yeah, put your css files in one place. Its neater for someone else to
come along and adjust your site if they have not seen it before.
Figure out a organization scheme and keep to it. This way precaching
is easier, some people dick around with the url to their style rules or
images by continually making new folders to store different types of
image content or whatever after the site is live and this prevents
effective caching by the browsers (if the directory path to a file is
different in anyway the browser assumes that its a new image or file).
So always keep to a scheme thats tidy and convenient for you eg:
seperation of all different file types.
 
M

Morgan

Yeah, put your css files in one place. Its neater for someone else to
come along and adjust your site if they have not seen it before.
Figure out a organization scheme and keep to it. This way precaching
is easier, some people dick around with the url to their style rules or
images by continually making new folders to store different types of
image content or whatever and this prevents
effective caching by the browsers (if the directory path to a file is
different in anyway the browser assumes that its a new image or file).
So always keep to a scheme thats tidy and convenient for you eg:
seperation of all different file types.
 
H

Hywel Jenkins

Morgan said:
Yeah, put your css files in one place. Its neater for someone else to
come along and adjust your site if they have not seen it before.
Figure out a organization scheme and keep to it. This way precaching
is easier, some people dick around with the url to their style rules or
images by continually making new folders to store different types of
image content or whatever and this prevents
effective caching by the browsers (if the directory path to a file is
different in anyway the browser assumes that its a new image or file).
So always keep to a scheme thats tidy and convenient for you eg:
seperation of all different file types.

Same reply twice and you still haven't figured out how to quote
properly. Read this:
http://www.allmyfaqs.com/faq.pl?How_to_post
 
R

Roy Schestowitz

__/ [Hywel Jenkins] on Monday 29 August 2005 18:35 \__
Same reply twice and you still haven't figured out how to quote
properly. Read this:
http://www.allmyfaqs.com/faq.pl?How_to_post

It's from Google Groups, Hywel. It's hard to educate a user as to what
netiquette is about /in full/. Many Google Groups users do not intend to
engage in heavy UseNet activity (or else a news reader would be used and
many ISP's have newsservers). Hence, they would not have much interest in
that link you provided.

There are worse 'sins' than neglecting to quote. How about top-posting,
making it an HTML-formatted message contained AS AN ATTACHMENT (all CAPS)
with an 8-line sig? It almost becomes amusing.

Thanks muchly for the follow-up, Morgan.

Roy
 
E

Els

Roy said:
__/ [Hywel Jenkins] on Monday 29 August 2005 18:35 \__

[snip reply to unknown post]
It's from Google Groups, Hywel. It's hard to educate a user as to what
netiquette is about /in full/. Many Google Groups users do not intend to
engage in heavy UseNet activity (or else a news reader would be used and
many ISP's have newsservers). Hence, they would not have much interest in
that link you provided.

They might wanna try this one though:
http://www.safalra.com/special/googlegroupsreply/
 
A

Arne

Once said:
Yeah, put your css files in one place. Its neater for someone else to
come along and adjust your site if they have not seen it before.
Figure out a organization scheme and keep to it. This way precaching
is easier, some people dick around with the url to their style rules or
images by continually making new folders to store different types of
image content or whatever after the site is live and this prevents
effective caching by the browsers (if the directory path to a file is
different in anyway the browser assumes that its a new image or file).
So always keep to a scheme thats tidy and convenient for you eg:
seperation of all different file types.

You will be ignored if you top post, don't quote what you are
replying to and cuting of only the signatures!

http://www.safalra.com/special/googlegroupsreply/
 
A

Andy Dingley

On my site which is mainly images, I keep my images in a separate folder,
mainly because it makes them easier for me to find. Every .htm/.html page
uses two css files.

I'd keep the images close to the HTML, and use lots of subdirectories.
You may well have large portions of the site with a directory, a single
index.htm and lots of images all in the same directory.

An "images" directory is unnecessary. Per-directory it doesn't hurt,
but neither does it add anything you can't get from a simple sorted
directory listing.

Identify image sizes (if needed) with a suffix of "_tn" or similar,
rather than a prefix, because it's much easier to get useful directory
listings that way.

An "images" directory per-site is a bad thing. This is throwing away
organisation you could beenfot from (by sections) in favour of something
that you could get just as easily with file extensions.

An "iconic images" directory can be useful, if you have a small set of
images that are referred to from many pages, such as site section
navigation icons. Don't be afraid to duplicate these files if they're
already thumbnails - it's easier than maintaining funny links to
thumbnails in the main "image library" part of the site.

All directory names should be flattened to lower-case and have simple
punctuation (i.e. "_" is the only whitespace character) Anything else
just causes trouble.

CSS OTOH is shared from all pages, for a small number of files. So these
are best stored in a single directory, one-level below the root. Refer
to it with a simple root-relative URL, so that re-arranging pages in the
future is easy,

If you have text-as-images headers, stick them in a sub-directory under
the CSS (unless you care about NS4 support). There's usually too many to
keep the CSS directory tidy if you leave them in there themselves.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top