SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: absolute within relative//IE 6 & 7 mock me//what bug is this?

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Feb 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy absolute within relative//IE 6 & 7 mock me//what bug is this?

    I'm trying to use absolute positioning within a relatively positioned div to keep an image near the bottom of the container--i.e., in the same (vertical) spot on every div:

    Witness code:
    http://catapult-creative.com/plp_test/index.html

    The "Learn More" images are what I'm hoping to keep in a uniform spot near the bottom.

    Works as hoped in Ffox, jacked in similar ways in MSIE 6 & 7.

    I'm sure this is just another positioning bug I'm not familiar with. Tried applying Holly Hack to containing div, but no dice.

    Any help will be greatly appreciated!

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,481
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why are you using XHTML code with an HTML doctype?

    IE is incorrectly making .tocq_promo_body clear .tocq_promo_image. Add clear:both to .tocq_promo_body and then change its height.

    I suggest you read Tips on Debugging Layouts.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    SitePoint Award Recipient Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    37,780
    Mentioned
    99 Post(s)
    Tagged
    3 Thread(s)
    Ho,

    What Kravvitz said plus you will also need to set the left position on the image for IE otherwise the horizontal position will be different.

    Code:
    .tocq_promo_body {
        width: 157px;
        height:200px;
        padding: 5px;
        top:10px;
        position:relative;
     clear:both;
    }
    
    img.learn_more {
        display:block;
        position:absolute;
        bottom:10px;
        left:10px;
    }

  4. #4
    SitePoint Member
    Join Date
    Feb 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the tips, guys. Krav, this link looks really useful--thanks for passing it along! Sorry it took me so long to repost. I'll make these changes and see what happens.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •