treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Navigation bar moves on (Zoom in & Zoom out)

  • So as the title, need some help. Cant get my Navigation Images to stay in position.

    <a href="index.html">
    

    #menuhome 
      {
      position: absolute;
      width: 200px;
      height: 150px;
      top: 20px;
      left: 920px;
      background-image:url(images/home.png);
      background-repeat: no-repeat;
      }
    
    #menuhome:hover { 
    background-image : url(images/homehover.png); 
    }
    
  • Can you put this in Codepen?

    However, my initial guess is because you are using absolute positioning.

    It's just my opinion but absolute position is usually a BAD idea unless you are trying to achieve something specific.

    The are better, more flexible and easier to maintain ways of laying out your page.

    Also, this is because a declared pixel is not really a screen pixel :http://www.quirksmode.org/blog/archives/2010/04/a_pixel_is_not.html

    Eventually the way the browser will run out of space trying to cram all the pixels you have declared into a set width and the page breaks.