Spanning the Div
- Started
- Last post
- 7 Responses
- SteveJobs
i love vague titles, how about you?
ok, so imagine, if you will, three divs, all floated left inside a container div that clears both. got it? alright, well, the 1st and 3rd div act as sides with a set width and height, but the 2nd div sits in the middle and should expand out to the full width of the container div, minus the widths of the 1st and 3rd. does that make sense? i hope so, because I'm at a loss on how to accomplish this. none of these divs contain any content.
for your viewing pleasure:
http://pastebin.com/U9aiKwKN
- noel0
google for "three column layouts"
- uan0
your divs need widths, that's why it's not working, give div2 a margin:auto and some content and it will work
- bulletfactory0
these divs won't have any content? how about using 1 div.
left border of Xpx and a color ex: border-left:20px #000 solid;
right border of Xpx and a color ex: border-right:10px #ccc solid;- ^ thatbulletfactory
- < I was wondering about those 1px div1 and div3 toouan
- SteveJobs0
sorry, i think in trying to simplify what i was after, i actually presented the problem incorrectly.
basically i'm just creating a top and bottom border where the 1st and 3rd divs will use a background image as a corner. i tried the margin:auto and just putting an in there, but maybe i misunderstood:
- uan0
I think to do that, you would need a div width floating right (for the right corner), then a div width floating left (for the left corner), and then the div with the content. all of them wraped in a div with some width-value to control the overall width.
something like this: http://pastebin.com/fPCLRUPc
- abettertomorrow0
Here's your answer right here
- "Liquid layouts with negative margins"abettertomorrow
- good read, thanks!SteveJobs