Th0rndike
Th0rndike

Reputation: 3436

How to make the 'content' div float to the right of 'subMenu' div?

I know this is very simple, but i've been struggling for a while and I just can't make it work. I thought someone here might be able to give me a quick answer.

I'm trying to make a div float and align with another div. I'm trying by changing the float and display css attributes but with no luck.

I've set up a jsFiddle: jsFiddle

Thanks in advance

Upvotes: 0

Views: 147

Answers (2)

frenchie
frenchie

Reputation: 51947

Here: jsfiddle

I just changed the height of the div for the example to appear better but you can set it back to your heights for your site.

I'd set the margin-top on the whole container div so that you only define that property once instead of setting it for both the menu and the content separately: anytime you're defining a value twice, you should try to put a wrapper and define it only once.

Upvotes: 2

Zoltan Toth
Zoltan Toth

Reputation: 47667

Your code works well if the screen is wide enough. Only if it's not the #content gets pushed under the submenu. To fix that give your #container a width that can accomodate both - http://jsfiddle.net/zaRqz/11/

#container {
    width: 1040px;
    overflow: hidden;
}

Upvotes: 2

Related Questions