SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Thread: Keeping large sites organized?
-
Nov 1, 2004, 14:39 #1
- Join Date
- Oct 2004
- Location
- Michigan
- Posts
- 45
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Keeping large sites organized?
I have come to the conclusion that it is much easier to maintain a large site that uses css for design rather than messy tables, but this brings rise to another question. How do you keep all of your css information organized? It seems to me that for a large site you are going to need tons of "#ids" in your css code in order to position everything correctly.
So... what methods do you all use to limit your css coding for a site and to keep it neatly organized?BeauCreative Web Development
FotoFight Photography Contests
Engolfed - Link Exchange? Write for us? PM Me.
datingUpdate | BiographyCollection - Link Exchange? PM Me.
-
Nov 1, 2004, 14:44 #2
- Join Date
- Apr 2004
- Location
- Arlington VA
- Posts
- 2,094
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
well you could separate css classes etc into a couple different css files....
you can also try to make the code as clean as possible by having styles inherit properties for other styles to avoid repeating things (font names, colors) for example... and also making changes easier.
-
Nov 1, 2004, 14:48 #3
JRMillion is right on the money. Keep your selectors simple, use CSS shorthand, avoid repeating rules, and use inheritance whenever possible. You can definitely reduce the amount of extra classes/IDs to very low amounts with this method (kind of like database normalization), though you might have to add some of this stuff in for other purposes like scripting (kind of like doing some denormalization on a database
).
-
Nov 1, 2004, 15:45 #4
- Join Date
- Jun 2004
- Location
- Minneapolis, MN
- Posts
- 168
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You can also use comment tags to split things up. For example, I use something like
Code:/* Home Page */ << comment tag #ID { margin: ... }
-
Nov 1, 2004, 16:51 #5
- Join Date
- Oct 2004
- Location
- Uppsala, Sweden
- Posts
- 516
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The other guys are already at it. But this goes for pretty much all programming I think, keep it simple. Separate instead of crazy bundling in one file, write comments and make it easy to find the part of the code that you're looking for. However, the way to accomplish this is another issue, just choose the way that you're most comfortable with. But be consistent and stick to one way, otherwise you'll just end up confused again.
-
Nov 1, 2004, 17:17 #6
- Join Date
- Apr 2003
- Location
- sowth afreeka
- Posts
- 374
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If you have a really long winded and LOADS of lines of code, and you think that you are going to loose your structure easily, then I find it usefull to comment my structure also. When I have a PHP page that is 5000 lines, I comment it like this;
PHP Code:<?php
if ($something) { // Start If statement
$do_something
}// End If statement
else {
$do_something_else
}
?>
HTML Code:<body> <!-- Start Container DIV --> <div id="container"> <! Start Left Column --> <div id="left"> </div> <!-- End Right Column --> </div> <!-- End Container DIV --> </body>
Also as everyone has suggested, the separate style sheetsI personally make one "main" style sheet and then @import all the others into that.
/OxMy postings are a natural product.
The slight variations in spelling and grammar enhance its
individual character and beauty and in no way are to be
considered flaws or defects - http://www.guinnesspig.net
Bookmarks