PDA

View Full Version : 3 column design css problem


Adan0s
03-25-2011, 06:37 PM
I'm currently trying to port my new design to vB 4.1.2


Header is fixed over 100%
left and right there are specific images which are each 139px wide
the body_wrapper itself should be between those both graphics, always fit the browser width


It looks generally something like this (won't show my final design here):
http://www.adan0s.de/misc/template.png

At the moment I added two div-layer before body_wrapper and after above_body.

<body>
<div class="above_body">

<div id="bg_left"></div>
<div id="bg_right"></div>

<div class="body_wrapper">
<div class="below_body">
...

The css code looks like this:


#bg_left {
background-image: url(bg_left.png);
width: 139px;
height: 600px;
float:left;
}
#bg_right {
background-image: url(bg_right.png);
width: 139px;
height: 600px;
float:right;
}

.body_wrapper{
margin-left: 139px;
margin-right: 139px;
min-height: 600px;
}


Unfortunately due to the massive CSS-amount of vB it just greatly messes up the inner style of the body_wrapper probably because of the floats.

https://vborg.vbsupport.ru/external/2011/03/7.png

As you can see the whole content itself starts after the 600px of the two bg_left/right.
Someone here who actually managed to realise such a layout?

greetings,
Adan0s

TheLastSuperman
03-25-2011, 10:16 PM
<a href="https://vborg.vbsupport.ru/showthread.php?t=255222" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=255222</a>

Now on that note, I have noticed depending on what side you want the third "column" that it can give you styling issues so I have admittedly used tables/td code to do this as well w/o any issues.

Adan0s
03-29-2011, 01:26 PM
Thank you for your answer.
Unfortunately none of those tricks did help.
I really don't know what to do now. I'm pretty firm with CSS but due to the fact that there are like 10000000 styles are taking action I just don't get it. And I really don't want to mess around with tables.

Lynne
03-29-2011, 03:06 PM
Can we get a link? It's really hard to figure out CSS issues just from an image.

Adan0s
03-29-2011, 05:59 PM
Aye, good point.

-link removed-

I found a workaround which fixes the issue. If you look closely even though the content is aligned correctly it starts right after the background-images end (600px).
So, if I add "margin-top: -600px" to the body_wrapper it works as it should. But as you might figure that's a really...bad fix.

Lynne
03-30-2011, 01:33 AM
The problem is the height you are giving to the side divs. Are those only there to add the image background? Why not just add the image to the actual background CSS? If you google "3 column CSS layout", you'll get a lot of information about what you need to do to get it to work. Your's works fine without the height, so your problem is specific to that and you'll have to try to narrow your searching down to that.

Adan0s
03-30-2011, 02:44 PM
Thank you. I used an other 3 column css layout and now everything works (even though chrome12 shows an error, but that might depend on the dev version).

I used the following layout: http://www.alistapart.com/articles/holygrail/
and wrapped it around the body_wrapper.

Lynne
03-30-2011, 03:46 PM
Glad you got it figured out. :)