css stored where?

Discussion in 'HTML' started by Jim S, Dec 18, 2006.

  1. Jim S

    Jim S Guest

    Where is it conventional to store css files?
    My html files are in the root directory and my images are in a folder in
    that directory. Do I store my css files with the images or with the html
    files?
    Further to that I have a sub-web (my words) where there is a different site
    with its own index.html. It too has css files and images folder so the
    question arises again.
    Or does it not matter?
    --
    Jim S
    Tyneside UK
    http://www.jimscott.co.uk
    Jim S, Dec 18, 2006
    #1
    1. Advertising

  2. Jim S wrote:
    > Where is it conventional to store css files?
    > My html files are in the root directory and my images are in a folder in
    > that directory. Do I store my css files with the images or with the html
    > files?
    > Further to that I have a sub-web (my words) where there is a different site
    > with its own index.html. It too has css files and images folder so the
    > question arises again.
    > Or does it not matter?

    Personal preference really. I use a /styles folder.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Dec 18, 2006
    #2
    1. Advertising

  3. Jim S

    Rik Guest

    Jim S wrote:
    > Where is it conventional to store css files?
    > My html files are in the root directory and my images are in a folder
    > in that directory. Do I store my css files with the images or with
    > the html files?
    > Further to that I have a sub-web (my words) where there is a
    > different site with its own index.html. It too has css files and
    > images folder so the question arises again.
    > Or does it not matter?


    It does not really matter, allthough you preferably store the css files on
    the same domain.
    When you're using just one, the root will be fine. When you're using
    several, you might want to make a different directory for them ('style' or
    'css' or something like that), just to simplify keeping track of your
    files.
    --
    Rik Wasmus
    Rik, Dec 18, 2006
    #3
  4. Jim S

    dorayme Guest

    In article <>,
    Jim S <> wrote:

    > Where is it conventional to store css files?
    > My html files are in the root directory and my images are in a folder in
    > that directory. Do I store my css files with the images or with the html
    > files?



    Well, not with the images, why would you do that? If you have
    just one or two sheets, just along with the html. If more, put
    them in a folder, call it whatever. Everything depends on how
    convenient you find it. On a large site with many sections and
    folders, it is sometimes convenient to put in any css peculiar to
    that section within that section. Again, either at the top of
    that section or in a folder if there are a number of special css
    sheets for that section.

    --
    dorayme
    dorayme, Dec 18, 2006
    #4
  5. Jim S

    the red dot Guest

    "Jim S" <> wrote in message
    news:...
    > Where is it conventional to store css files?
    > My html files are in the root directory and my images are in a folder in
    > that directory. Do I store my css files with the images or with the html
    > files?
    > Further to that I have a sub-web (my words) where there is a different

    site
    > with its own index.html. It too has css files and images folder so the
    > question arises again.
    > Or does it not matter?
    > --
    > Jim S
    > Tyneside UK
    > http://www.jimscott.co.uk


    i only have my index.html file in the root all other pages go in a folder
    called html, images go in a folder called images, and css goes in a folder
    called css. if you have another 'sub-site' that would go in a folder called
    'whatever you want' and would then be laid out the same way as the main
    site. i hope that makes sense.
    the red dot, Dec 19, 2006
    #5
  6. Jim S

    Guest

    Jim S wrote:
    > Where is it conventional to store css files?


    Wherever you wish. Our group keeps the same directory structure for
    each subgroup:

    /html
    /images
    /css
    /clientjs
    /xsl
    /tables (xml constants)
    .. etc

    So we know exactly where to go for each kind of file.

    Kev
    , Dec 19, 2006
    #6
  7. Jim S

    Neredbojias Guest

    To further the education of mankind, Jim S <>
    vouchsafed:

    > Where is it conventional to store css files?
    > My html files are in the root directory and my images are in a folder
    > in that directory. Do I store my css files with the images or with the
    > html files?
    > Further to that I have a sub-web (my words) where there is a different
    > site with its own index.html. It too has css files and images folder
    > so the question arises again.
    > Or does it not matter?


    I usually store mine in a sub-directory of the html directory called
    "constantinoples_sardines_suck" just to relieve the boredom.

    --
    Neredbojias
    Infinity has its limits.
    Neredbojias, Dec 19, 2006
    #7
  8. Jim S

    Toby Inkster Guest

    Jim S wrote:

    > Where is it conventional to store css files?


    On a publically-accessible web server. (Doesn't need to be the same server
    as the pages themselves.)

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Dec 19, 2006
    #8
  9. Jim S

    Andy Dingley Guest

    Jim S wrote:

    > Where is it conventional to store css files?


    CSS is (generally) a site-wide shared feature, so store it somewhere
    that's accessible with an equal path from a page anywhere on the site.
    "/", "/styles/" or "/css/" all work fine. Just make sure you begin the
    references to it with a "/" so that they're absolute.

    Photos, in contrast, are usually bound to a particular page. So don't
    have a "/photos/" directory, dumpe everything into it and have to worry
    about a rats-nest of paths and refereneces from other pages. If you
    have a few images used for "page furniture" (borders, rules etc.) then
    _those_ can go in a site-wide directory called "/images/" etc., just
    like the CSS

    As always, keep the root directory clear. It's always easier to keep it
    (or any similar directory) clear from the beginning than to fill it to
    the unwieldy level, then have to try and move things out later.
    Andy Dingley, Dec 19, 2006
    #9
  10. Scripsit Andy Dingley:

    > CSS is (generally) a site-wide shared feature, so store it somewhere
    > that's accessible with an equal path from a page anywhere on the site.
    > "/", "/styles/" or "/css/" all work fine.


    That's fine site-wide stylesheets. Others might be put into topical
    directories. The use of stuff like "/styles/" or "/css/" is common but
    largely overkill. If you have a single site-wide stylesheet, you might just
    as well put it into the main directory of your web pages. But if you have
    several alternative stylesheets, perhaps divided into separate files for
    technical reasons, and hopefully with documents that explain the
    stylesheets, a subdirectory is a useful way to organize things.

    > Just make sure you begin the
    > references to it with a "/" so that they're absolute.


    A URL that begins with "/" is by definition relative, not absolute, by the
    Internet-standard on URL (URI) syntax. What matters is that it is relative
    to the server root, not to the base URL of the referring document.

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Dec 19, 2006
    #10
  11. Jim S

    Jim S Guest

    On 19 Dec 2006 01:34:14 -0800, Andy Dingley wrote:

    > Jim S wrote:
    >
    >> Where is it conventional to store css files?

    >
    > CSS is (generally) a site-wide shared feature, so store it somewhere
    > that's accessible with an equal path from a page anywhere on the site.
    > "/", "/styles/" or "/css/" all work fine. Just make sure you begin the
    > references to it with a "/" so that they're absolute.
    >
    > Photos, in contrast, are usually bound to a particular page. So don't
    > have a "/photos/" directory, dumpe everything into it and have to worry
    > about a rats-nest of paths and refereneces from other pages. If you
    > have a few images used for "page furniture" (borders, rules etc.) then
    > _those_ can go in a site-wide directory called "/images/" etc., just
    > like the CSS
    >
    > As always, keep the root directory clear. It's always easier to keep it
    > (or any similar directory) clear from the beginning than to fill it to
    > the unwieldy level, then have to try and move things out later.


    Are you saying that each page should have its own /images folder rather than
    having all the images (photos in my case) in one folder?
    --
    Jim S
    Tyneside UK
    http://www.jimscott.co.uk
    Jim S, Dec 19, 2006
    #11
  12. Jim S

    Andy Dingley Guest

    Jim S wrote:

    > Are you saying that each page should have its own /images folder rather than
    > having all the images (photos in my case) in one folder?


    First of all, each page can't have its own "/images" directory. If it
    begins with "/", it's root-relative (as Jukka correctly points out) and
    there's only going to be one of them.

    Nor ought it to have a "images" sub-directory, Not because it's wrong,
    but because it's pointless. Keep your per-page images close to the
    pages that use them, it's just easier to organise like that. "images"
    sub-directories are one more level of hassle and they add nothing.
    Andy Dingley, Dec 19, 2006
    #12
  13. Jim S

    Jim S Guest

    On 19 Dec 2006 04:48:25 -0800, Andy Dingley wrote:

    > Jim S wrote:
    >
    >> Are you saying that each page should have its own /images folder rather than
    >> having all the images (photos in my case) in one folder?

    >
    > First of all, each page can't have its own "/images" directory. If it
    > begins with "/", it's root-relative (as Jukka correctly points out) and
    > there's only going to be one of them.
    >
    > Nor ought it to have a "images" sub-directory, Not because it's wrong,
    > but because it's pointless. Keep your per-page images close to the
    > pages that use them, it's just easier to organise like that. "images"
    > sub-directories are one more level of hassle and they add nothing.


    Silly me, but it was not really what I meant.
    At present all my html files (inc index.html) are in the root directory.
    Also in there is a folder called 'images' where all the images live.
    This must be the shortest path length, but it involves a fair bit of
    searching for me since there hundreds of them.
    --
    Jim S
    Tyneside UK
    http://www.jimscott.co.uk
    Jim S, Dec 19, 2006
    #13
  14. Jim S

    Andy Dingley Guest

    Jim S wrote:

    > At present all my html files (inc index.html) are in the root directory.


    Then split your html files up into subdirectories. This has several
    advantages:
    - Smaller groups of related files are easier to manage (no more
    "hundreds in a directory" clutter)

    - Related groups can give you more structured URLs, such as
    http://example.com/section1/
    This also lets you skip the page name when you can just use a directory
    and the default document (it's not the only way to do this, but it's
    easy, convenient and a benefit of good structure)

    - Root is cleaner, and there's a few magic files in there that you
    might want to keep obviously visible, without clutter.


    > This must be the shortest path length,


    Shortest path length is no path length
    Andy Dingley, Dec 19, 2006
    #14
  15. Jim S

    Jim S Guest

    On 19 Dec 2006 06:34:55 -0800, Andy Dingley wrote:

    > Jim S wrote:
    >
    >> At present all my html files (inc index.html) are in the root directory.

    >
    > Then split your html files up into subdirectories. This has several
    > advantages:
    > - Smaller groups of related files are easier to manage (no more
    > "hundreds in a directory" clutter)
    >
    > - Related groups can give you more structured URLs, such as
    > http://example.com/section1/
    > This also lets you skip the page name when you can just use a directory
    > and the default document (it's not the only way to do this, but it's
    > easy, convenient and a benefit of good structure)
    >
    > - Root is cleaner, and there's a few magic files in there that you
    > might want to keep obviously visible, without clutter.
    >
    >> This must be the shortest path length,

    >
    > Shortest path length is no path length


    Thanks Andy. I'm sure you are right. I wish I had had this advice when I
    started.
    --
    Jim S
    Tyneside UK
    http://www.jimscott.co.uk
    Jim S, Dec 19, 2006
    #15
  16. Jim S

    j_hawk1979 Guest

    Jim S wrote:
    > On 19 Dec 2006 06:34:55 -0800, Andy Dingley wrote:
    >
    > > Jim S wrote:
    > >
    > >> At present all my html files (inc index.html) are in the root directory.

    > >
    > > Then split your html files up into subdirectories. This has several
    > > advantages:
    > > - Smaller groups of related files are easier to manage (no more
    > > "hundreds in a directory" clutter)
    > >
    > > - Related groups can give you more structured URLs, such as
    > > http://example.com/section1/
    > > This also lets you skip the page name when you can just use a directory
    > > and the default document (it's not the only way to do this, but it's
    > > easy, convenient and a benefit of good structure)
    > >
    > > - Root is cleaner, and there's a few magic files in there that you
    > > might want to keep obviously visible, without clutter.
    > >
    > >> This must be the shortest path length,

    > >
    > > Shortest path length is no path length

    >
    > Thanks Andy. I'm sure you are right. I wish I had had this advice when I
    > started.
    > --
    > Jim S
    > Tyneside UK
    > http://www.jimscott.co.uk



    another way would be by creating a folder called css (best in lower
    case)

    it should be stored in where the html and image folder is....

    ex:

    (page.html)(page2.html) (images folder) (css folder)

    when you call the css in your html coding.... don't forget to include
    the folder plus name of the css...

    Ex:

    css/style.css

    hope this helps...
    j_hawk1979, Dec 19, 2006
    #16
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric
    Replies:
    4
    Views:
    698
    clintonG
    Dec 24, 2004
  2. tom watson

    print.css and screen.css

    tom watson, Sep 9, 2003, in forum: HTML
    Replies:
    1
    Views:
    451
    Jukka K. Korpela
    Sep 9, 2003
  3. Joshua Beall
    Replies:
    1
    Views:
    408
    Bertilo Wennergren
    Dec 10, 2003
  4. Noozer
    Replies:
    10
    Views:
    2,034
    Mitja
    Oct 13, 2004
  5. Titus A Ducksass - AKA broken-record
    Replies:
    6
    Views:
    637
    Titus A Ducksass - AKA broken-record
    Nov 15, 2004
Loading...

Share This Page