The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How do I position an absolute div relative to a centered container

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #31943

    Hi Guys,

    Was wondering if one of you could help me out. Take a look at this link B Cake Studio

    You’l see that as you re-size your browser window the whole site shifts as the margin on the container is set to 0 auto so everything moves. Everything except for the logo. The logo is positioned absolute as I want the logo to overlay the menu div at the top as you can see in this image Click Here But I want the logo to be positioned absolute in relative to the centered container so that if the browser is resized then the logo div will move with the rest of the sites content.

    Can anyone help?


    You have to explicitly declare “position: relative;” for the #logo’s parent container, in order for the #logo to be positioned absolutely within the context of the #container.


    #container {position: relative; ...}
    #logo {position: absolute; ...}


    Cheers man – thanks for the speedy reply also – problem solved – simples :)

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.