Skip to content Skip to sidebar Skip to footer

Need To Fix An Image To A Specific Spot On A Page

I need to fix a .gif image to a specific spot on my home page. I've placed the image in my HTML, and 'position:fixed' doesn't do what I want - the rest of the page's content scroll

Solution 1:

If you use position:fixed, the element is positioned relatively to the window, so even if you scroll, the element doesn't move.

If you want it to move when you scroll, use position:absolute.

But because of your layout, you have 2 options:

  • Place the image inside #box
  • Remove the following code:
html{
    overflow:hidden;
    height: 100%;
    max-height: 100%;
}
body {
    height: 100%;
    max-height: 100%;
    width: 100%;
}
#box {
    height: 100%;
    max-height: 100%;
    overflow: auto;
    width: 100%;
}

Post a Comment for "Need To Fix An Image To A Specific Spot On A Page"