0

...and by 'no reason' I mean; for a reason I'm clearly (and likely blatently) overlooking. This is such a NOOB question - but I for the life of me can't figure out what's going wrong with my floating divs.

As seen here: http://codysilfies.com/kenji/beta.html

I've got a Container div (#Wrapper), which houses a few divs - among them a content area (#content) which has a menu (#menu) that floats left; and a div to house text (which doesn't have an ID just yet).

I THOUGHT that aligning them both left would have the two divs sit right against each other; but it's not working that way. The box with text overlaps the menu messing with the layout. I also have to place the text PRIOR to the menu in the code; or else it'll show up below the main menu (which shouldn't be normal behavior - it should sit against the other div!

I know I can set a width and float the text RIGHT - but it's been requested that the page resize with the browser page.

I know it's something stupid and simple that I'm overlooking...but I can't see it. Any help would be hot! Thanks in advance.

Cody S
  • 87
  • 2
  • 10
  • Weird. It works fine when I click it! I guess try: http://www.codysilfies.com/kenji/beta.html – Cody S Oct 30 '12 at 05:26

3 Answers3

0

HI now give to the margin-left:190px; in your float right div

as like this

<div style="float:right;margin-left:190px;">

result is

this

Rohit Azad Malik
  • 31,410
  • 17
  • 69
  • 97
  • Right - but then the text content is still pushing the menu content down below the div (the menu should be maybe half the size it is - if that). Ideally the menu would sit right next to the text, and be only the height of those two menu items. If you do:
    1
    and
    2
    - those two divs sit right next to each other. Why don't mine act the same way?
    – Cody S Oct 30 '12 at 22:29
0

also, remember the box model. It's generally a good idea to give a width to a floated element when it's more structure related, as this is, versus just an image. That will also help side-step issues in IE 7 and 8.

kelly johnson
  • 1,596
  • 3
  • 16
  • 26
  • The menu does have a fixed width - the only reason the other one does not is because I need the content to be able to expand/collapse if a user sizes or resizes their window. Setting a width to it kind of prevents that - and it doesn't solve the overlap problem. – Cody S Oct 30 '12 at 22:33
0

Solution was just me being dumb. I forgot to add a float to the menu. D'oh!

Cody S
  • 87
  • 2
  • 10