Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder Kevin_M_Schafer's Avatar
    Join Date
    Apr 2011
    Location
    Fairfax, Minnesota, U.S.A.
    Posts
    482
    Thanks
    97
    Thanked 17 Times in 17 Posts

    File folder management/configuration of a website

    I have a question regarding html, php, shtml, etc. pages and the css that goes with them. If I place my main navigation pages inside a folder marked "nav," for example, should the css for those pages be in that folder as well, or should the css for the entire site be inside one folder marked css? This may be a silly question, but I don't want to try to reinvent the wheel when someone else may have already discovered the best way to manage site folders.

    Thanks.

    --Kevin

    .
    My keyboard is an IBM from 1993 and I like it that way. | Who is Dan Well? Everyone always says I know Dan Well.Building a web page is like building a birdhouse. Put it up there and watch 'em come. | Maintaining the aspect ratio of an image is more important than having a cold orange pop.

  • #2
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,269
    Thanks
    10
    Thanked 277 Times in 276 Posts
    Hi Kevin,

    The organization of your site folders is up to you of course, based on whatever works well for you. So there isn't going to be a "this is the right way to do it" answer. I'm assuming you knew that, I'm just repeating it here.

    That said, what *I* do is organize my folders like:
    /site - this includes css, and other site organization stuff
    /images
    /articles - maybe I have a series of articles that get posted
    /data - maybe I have a folder of XML files or other data sources

    I keep all my normal user-accessible pages (php, html, etc) in the top-level folder.

    Typically my site.css file contains all my CSS (more efficient network-wise to load one CSS file than several). So I'd have a /* this is the css for navigation */ block somewhere in the larger css file. The exception I make to this is if I got my navigation (or other parts of the code) from some third party, where they deliver a package that includes a folder /bobs-cool-navigation which includes their code, documentation, css, etc. I will leave that stand as-is in their folder so that I don't need to change their links, or if I get an update from "bob" I don't need to do anything but drop the new code over the old code.

    Dave

  • The Following 2 Users Say Thank You to tracknut For This Useful Post:

    jon22 (01-25-2012), Kevin_M_Schafer (01-24-2012)

  • #3
    Regular Coder Kevin_M_Schafer's Avatar
    Join Date
    Apr 2011
    Location
    Fairfax, Minnesota, U.S.A.
    Posts
    482
    Thanks
    97
    Thanked 17 Times in 17 Posts
    Okay, I understand. Thanks, Dave. You answered another question that I have been tumbling around in my head as well: Do I use more than one css document. I've used the comments lines to keep track of different parts of the same page, but never to keep track of the styling of other pages. I like this idea and think I'll go with this approach. I can see how easy it would be to have just one css.

    Thanks for your help. I appreciate it.

    --Kevin

    .
    Last edited by Kevin_M_Schafer; 01-24-2012 at 06:46 PM. Reason: text clarity
    My keyboard is an IBM from 1993 and I like it that way. | Who is Dan Well? Everyone always says I know Dan Well.Building a web page is like building a birdhouse. Put it up there and watch 'em come. | Maintaining the aspect ratio of an image is more important than having a cold orange pop.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •