I have been using div layers for a site layout, and i’ve been controlling the div layouts through css. unfortunately, i have a problem.
I have two div layers, one is the main content and the other is the sidebar. The main content is set to float:left; while the sidebar is set to position:relative;. Depending on whether i put the content or sidebar first, one is always at the top and the other is diagnally right beneath it. What i’m trying to do is to get them both on the same level.
Please tell me if you need any more information to help solve this problem.
Thanks in advance to those who try to help me.
Try compressing the html and or posting it so we can look at the source ourselves, that way we can trouble shoot it. However this should solve your problem:
I’m gonna label the classes of your your left section .left and right .right (obviously)
Notice how the float and the positioning are the same on both DIVs. And depending on which one you put first, depends on which is on left, and which is on right. Hope this helps.
EDIT:
In case it doesn’t here is the coding I used:
I know that problem. I had it too when creating my site (it also uses two divs next to eachother). I positioned the left div absolute, and the right div relative with a left offset. If anyone has a better solution, I’d love to hear it
Make your #content and #sidebar, float: left, add position:relative. Like my above example. Of course that’s only if you’re set on keeping them floating. However it, it could be hard to put content in them while they are floating. If you do like Voet does, which would be more efficent, it would be easier to position some objects. Either way works… one is just a little harder to control.
the div problem is sort of solved - meaning i got the two to stay next to each other - but another two problems popped up. First off, the content now likes to extend beyond the table i have. second, the footer is like an inch before the end of the table.
i think it would be easier if you just saw the site itself so i’m giving you the URL http://calbruneninc.com
if you go to some of the other pages (except testimonials) you’ll see how the content overrides the table.