Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > css stored where?

Reply
Thread Tools

css stored where?

 
 
Jim S
Guest
Posts: n/a
 
      12-19-2006
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
 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      12-19-2006

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.

 
Reply With Quote
 
 
 
 
Jim S
Guest
Posts: n/a
 
      12-19-2006
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
 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      12-19-2006

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

 
Reply With Quote
 
Jim S
Guest
Posts: n/a
 
      12-19-2006
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
 
Reply With Quote
 
j_hawk1979
Guest
Posts: n/a
 
      12-19-2006

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...

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Layout question - how to duplicate a table layout with CSS Eric ASP .Net 4 12-24-2004 04:54 PM
confused - html validates, css validates but validate css from the html causes errors Titus A Ducksass - AKA broken-record HTML 6 11-15-2004 12:59 PM
Set CSS property equal to another CSS property? Noozer HTML 10 10-13-2004 09:20 PM
Is there a way to set the a CSS property to be explicitly the same as another CSS property? Joshua Beall HTML 1 12-10-2003 07:21 PM
print.css and screen.css tom watson HTML 1 09-09-2003 02:48 PM



Advertisments