Hi all,
I'm trying to setup a content section containing two divs, the main one and a sidebar to the right. I've done this tons of times with no problem but for some reason I can't get it to work this time...
I'll explain the scenario and then I'll post the source code so that you can help me out
First there is a container div, which has a padding of 50px in all sides except bottom one.
Inside that one I've placed two divs, one the main one and the other the sidebar. The main one has no width specified, and the right margin is the same as the sidebar's width + the margin that separates them. The sidebar is then floated right with a width of 285px, and a margin left of 20px. Now that usually works for me but this time I've probably forgot something somewhere which I can't find
Here is the html (plain)
And the CSS:
And here is a link to the actual page:
http://urbanoalvarez.es/test/
I'm still working on it so it takes a little longer than it should to load, but for now it doesn't matter...
I'm trying to setup a content section containing two divs, the main one and a sidebar to the right. I've done this tons of times with no problem but for some reason I can't get it to work this time...
I'll explain the scenario and then I'll post the source code so that you can help me out
First there is a container div, which has a padding of 50px in all sides except bottom one.
Inside that one I've placed two divs, one the main one and the other the sidebar. The main one has no width specified, and the right margin is the same as the sidebar's width + the margin that separates them. The sidebar is then floated right with a width of 285px, and a margin left of 20px. Now that usually works for me but this time I've probably forgot something somewhere which I can't find
Here is the html (plain)
| Code: |
| <div id="content">
<div id="main"></div> <div id="nav"></div> </div> |
And the CSS:
| Code: |
| /* Center container: */
#content{ width:100%; padding:50px 0 0 50px; } /* Center (Posts) styling */ #main{ margin: 0 355px 0 0; background-image:url(images/content.png); background-position:top; background-repeat:repeat-x; min-height:370px; padding:5px; border-right-color:#FFFCF0; border-right-style:solid; border-right-width:1px; border-left-color:#FFFCF0; border-left-style:solid; border-left-width:1px; } /* Right Sidebar styling */ #nav{ margin-right:50px; float: right; width:285px; background-image:url(images/sidebar.png); background-position:top center; background-repeat:no-repeat; min-height:398px; padding:5px; } |
And here is a link to the actual page:
http://urbanoalvarez.es/test/
I'm still working on it so it takes a little longer than it should to load, but for now it doesn't matter...
