1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Absolute Positioning problem

Discussion in 'CSS' started by valandil, Aug 8, 2008.

  1. #1
    Hi, guys I'm looking to position an image in a certain... well, position and I tried using absolute positioning but I realize that it appears at different places for different monitor resolutions.

    Any suggestions? The image is to be positioned beside (but overlaying) a form.

    Here's an example: http://www.7dayrealestatesale.com/

    he's using the whole graphic, I want to use css instead.
     
    valandil, Aug 8, 2008 IP
  2. steelfrog

    steelfrog Peon

    Messages:
    537
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can float the image and use a negative margin to achieve the same effect.

    For example, you could try:
    
    img.whatever { float: right; margin-right: -60px; }
    
    Code (markup):
     
    steelfrog, Aug 8, 2008 IP
  3. Divisive Cottonwood

    Divisive Cottonwood Peon

    Messages:
    1,674
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #3
    negative margins and floats won't work in ie6 though
     
    Divisive Cottonwood, Aug 9, 2008 IP
  4. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yeah, they do. Negative margins work even with IE5.5.

    Floats work, although depending on the situation IE6 may double the side margins. IF and only IF it does that, add display: inline; in the same place as your float declaration:
    #element {
    float: left;
    display: inline;
    other stuff;
    }

    Magically fixes bug.
     
    Stomme poes, Aug 10, 2008 IP