Get an image to stay on top(not when scrolling)

Discussion in 'CSS' started by walruus, Oct 18, 2008.

  1. #1
    Hi

    I am trying to get an image to stay at top of the page, but can't seem to find any good solution to it. I've tried position:absolute; but then all the content of the page wen't with it, and messed it all up.

    Im NOT trying to get the image to always stay on top (when scrolling). Im just trying to get it to stick to the top without any space between.

    Here is my code (that didn't work) :

    padding-left:6%;
    padding-top:0;

    I tried only top:0; also, to no success.. Anyone who could help me out on this one? Im sure this is basic CSS, you could tell it's been a while.

    Thanks
     
    walruus, Oct 18, 2008 IP
  2. estetique69

    estetique69 Peon

    Messages:
    41
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    #headerimg { 
    margin-top: 0px
    }
    Code (markup):
    Try this one :p
     
    estetique69, Oct 19, 2008 IP
  3. walruus

    walruus Member

    Messages:
    332
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #3
    Thanks, but I figured it out now. What i did was to move the div="headerimg" out from the wrap. The result; instantdomain.name

    Just woke up, and it all came to me :p
     
    walruus, Oct 19, 2008 IP