Question questions about laying out pages with divs comments ( SitePoint Forums Just Starting Your Design ) Updated: 2008-08-12 05:53:02 (3) |
|
questions about laying out pages with divs comments
Hello,
hows things going out there hope everyone is good!
I am kind of interested to know if the method I have adopted for creating webpages is the most practical and usefull?
When I create pages I use one main div to contain all the other div's, such as
..
<div id='mainDiv'>
<div id='header'>some stuff blah blah</div>
<div id="mainContent">the main content text interesting stuff </div>
<div id="footer">some footer text things here"></div>
</div>
</body>
Is this the best method to create layouts or should they all be seperate and not nested in this fashion or is all a matter of taste.
The reason I ask is I am thinking I might be making the code more messy than it needs to be and just interested to know workflows of other designers
thanks
happy holidays
stefan
|
|
| Answers: questions about laying out pages with divs comments ( SitePoint Forums Just Starting Your Design ) |
|
questions about laying out pages with divs comments
I think if the layout is that simple then one container box seems fine. I've not used css long enough to qualify as an expert but some people use separate container boxes for each section so they can have better control of all elements like graphics, menus, etc.
Melter
|
|
questions about laying out pages with divs comments
thats what I was thinking my method seems a tiny bit complicated as the main content can simply be controlled with the body tag and the wrapper div isn't really needed unless borders are to be added which seem like the only thing I can think which makes it of use.
I think I need to follow more book tutorials to find a better way of coding elements up as my code seems to be a all over the place, I want to find the best way of doing things so I'm not added lots of useless code when it can all be declaired in a style sheet and styled elements accordingly.
I think its only just dawned on me does this make me a geek or someone very very sad
stefan
stefanburt
|
|
questions about laying out pages with divs comments
Your method is perfectly normal. You are ruling out separate sections of the site, not elements!
- Use <div>'s to separate sections
- Use lists for navigation(s)
- use <span>'s for inline styling
- use <p>'s for text on the site
ID and Class containers as necessary.
You can't separate your content in a stylesheet, so don't be afraid to use <html> tags (sparingly) for what they're made to do.
A mistake I made when first gettin into CSS was wrapping everything and anything. For example wrapping a logo img in a div to position it absolutely, when I could have just as easily positioned the img itself without the div around it.
Why don't you examine some of the experts' sites like Eric Meyer and see how they go about coding.
Egor
|
|
- Source: - Previous Question: SitePoint Forums Just Starting Your Design - Next Question: GameTrailers.com Forums LittleBigPlanet |
|
|