Forums

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

Home Forums CSS [Solved] fixed image on the side of div

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #150441
    allison7860
    Participant

    So I have centered divs with margin 0 auto. At the end of all my divs, I added another div to add an arrow to go up the page. I want it to show as fixed position, so when scrolling down you still see it. But then again I have resolution of 1920×1200 screen, and when minimized the image overlaps my divs. Please help thanks! ~allison

    I have :

    arrow {position:fixed; top:700px; right:510px;}

    #150444
    Paulie_D
    Member

    Can you provide a live link, or a Codepen?

    However, I think you are going to have to use a media query to re-adjust the position of the div arrow based on the viewport width,

    #150446
    allison7860
    Participant
    #150448
    Paulie_D
    Member

    Hmmm…not much you can do about that as it is…it’s precisely where you told it to be…maintaining 510px distance from the right of the viewport.

    Media Queries would solve that…but I’m sure there must be another simpler solution…but I haven’t had my coffee yet.

    :)

    I’ll keep thinking.

    #150451
    Paulie_D
    Member

    Hmmm…I had a idea which was like this: http://codepen.io/Paulie-D/pen/hJLsF

    Unfortunately, you have an odd HTML structure & CSS positioning going on in your content sections which makes this a little harder.

    #150490
    wolfcry911
    Participant

    change the right: 510px to left: 50%; and add a left margin (approximately 400px)

    #150492
    Paulie_D
    Member

    See…I should have known someone cleverer than me (and there are many) would fix it.

    I always forget that you can add margin to absolutely positioned items….:)

    #150505
    allison7860
    Participant

    Thank you guys for the help and time much appreciated!

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