Hey Guys,
Stupid question number 2 here I think (But I did Google it first). I have a bunch of divs, one div has the content area, and when it goes past its full standard length, it expands, but does not push any of the lower divs down, and it goes under them. All divs are set to "position: absolute" and it was generated by Photoshop CS2. So how do I set it, so that all lower divs, are responsive to height adjustments from divs above?
CSS - Divs
Moderator: General Moderators
- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
Don't use position:absolute.
That will take each div out of the normal document flow, and just place it in it's position, without consideration of surrounding elements. So things start to overlap if you're not careful.
Just start with your markup inside the divs, with no styling. You'll see how everything flows nicely when you increase the text size for example. After that, you can start using floats if you want columns for example.
That will take each div out of the normal document flow, and just place it in it's position, without consideration of surrounding elements. So things start to overlap if you're not careful.
Just start with your markup inside the divs, with no styling. You'll see how everything flows nicely when you increase the text size for example. After that, you can start using floats if you want columns for example.
- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
Use floats.
You could use positioning, but the problem with that is that it isn't scalable. You almost never know how much content a box will contain or how much space that content will take (if we're talking text). So you never know how much vertical space a box will take in someone's browser.
With floats, everything just flows in place and adjusts nicely to the content it contains.
If you don't know much about CSS yet though I would read some tutorials about the basics (floating, positioning, etc) first.
You could use positioning, but the problem with that is that it isn't scalable. You almost never know how much content a box will contain or how much space that content will take (if we're talking text). So you never know how much vertical space a box will take in someone's browser.
With floats, everything just flows in place and adjusts nicely to the content it contains.
If you don't know much about CSS yet though I would read some tutorials about the basics (floating, positioning, etc) first.
nickvd is correct. If you don't know any/much CSS, but you do know how to make sites with tables and you have an impatient client waiting for his site: fall back to a table (or two). If you do have the chance to learn how to do it with CSS, it's worth your time. You'll have to take a few frustrating evenings debugging for granted then 
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
Another "cheat" I use is to look out for free templates already on the web. Open Source Web Design is one site I have used in the past.
You do not have to use the templates as they are you are free to modify them, but it gives you a good starting point.
You do not have to use the templates as they are you are free to modify them, but it gives you a good starting point.