Horizontal Alignment - css

  maanse 17:52 21 Sep 08
Locked

Any ideas how i would go about putting two items next to each other. Both items are in a DIV.

Basically i have the content of a page centered in a div with the div centered on the page. Now i want to add a menu to the page so that it sits to the left of the content without pushing the content down.

all help will be greatly appreciated.

  Kemistri 19:37 21 Sep 08

Add relative positioning and auto margins to your container and include a width declaration. Float your main division, with a width dec and margins. Drop your left div into place with absolute positioning, with left and top decs to suit, and size it accordingly. Job done.

  maanse 20:54 21 Sep 08

Hi, Kemistri

Thanks for the response, have done what you suggested but im still not getting the menu in the right place. I think maybe it could be something to do with the menu itself, as it contains its own css and js. im wondering if maybe my css is being ignored because of the menu css.

Is that possible? If so is there a way around it without editing the menu's css?

  maanse 20:54 21 Sep 08

Hi, Kemistri

Thanks for the response, have done what you suggested but im still not getting the menu in the right place. I think maybe it could be something to do with the menu itself, as it contains its own css and js. im wondering if maybe my css is being ignored because of the menu css.

Is that possible? If so is there a way around it without editing the menu's css?

  maanse 21:03 21 Sep 08

appologies for the double post......

Also i have figured out why it wouldnt work. It was my fault.... School boy error i had a . instead of a # in my css script.

next question is....

Is there a way that same left item can be visible when the page scrolls( ie the menu scrolls with the page)

thanks again kemistri

  Kemistri 21:30 21 Sep 08

Yeah, there is. Fixed positioning. Absolute positioning fixes an element to another part of the layout, but fixed positioning takes it completely out of the layout and fixes it to the viewport instead.

  maanse 21:40 21 Sep 08

Ahh i get it. easy as that eh. Shame im not happy with the design of the menu structure.

Still its coming along slowely.

Thanks again.

This thread is now locked and can not be replied to.

Intel Coffee Lake 8th-gen Core processors release date rumours

1995-2015: How technology has changed the world in 20 years

Framestore’s haunting post-WWII title sequence for new BBC series SS-GB

How to install MacOS Sierra on an older Mac: Get Sierra running on Macs & MacBooks from before 2009