Absolute postioning within relative positioning...

Discussion in 'HTML & Website Design' started by bikram_068, Mar 31, 2010.

  1. #1
    Hi everyone..
    I have absolutely positioned an image in my website.When I see it in a browser with 100% view, it is seen in the right place.But when browser width is other than 100% , the image seems static and misplaced with other content.But all other content are in right place.

    How can I make the image placed in the right place for any width of browser ?Can it be someway absolutely positioned within relative?

    Thanks.
     
    bikram_068, Mar 31, 2010 IP
  2. parotstalk

    parotstalk Peon

    Messages:
    43
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can it be someway absolutely positioned within relative? - The quick answer is yes create a div say ".image_holder {position: relative;}" then you can absolute postion your img within it.
     
    parotstalk, Mar 31, 2010 IP
  3. bikram_068

    bikram_068 Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ya Parot...
    I had done as you said...but when I reduce the browser's zoom to other than 100%, the image is shifted from its position and misplaced.How can I remove that problem?
     
    bikram_068, Mar 31, 2010 IP
  4. parotstalk

    parotstalk Peon

    Messages:
    43
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi Bikram

    PM me your CSS file and give me your URL and tell mne which image etc you are refering to
     
    parotstalk, Mar 31, 2010 IP
  5. bikram_068

    bikram_068 Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi Parot;;

    I have sent two private msgs to you..Please check your pm.
    thanks
     
    bikram_068, Mar 31, 2010 IP
  6. Mentalhead

    Mentalhead Active Member

    Messages:
    1,344
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    53
    #6
    Problem with absolute positioning inside a a relative div is that sometimes if you resize your browser window your absolute element may "fly" away or something like that.
    Why don't you try to use relative positioning inside relative div, it might help.
     
    Mentalhead, Mar 31, 2010 IP
  7. designmonkey

    designmonkey Peon

    Messages:
    70
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    bikram,
    AFAIK for the case of Absolute positioned element inside Relative container block, the absolute position coordinate would be calculated from that Relative container block.

    If you want your absolute positioned element not move ( ie. you calculated it from the edge of the page), you should take it out from that Relative block.
     
    designmonkey, Mar 31, 2010 IP