SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Clearing floats?

    HI,

    can you take a look at :http://www.geocities.com/clbasey/floatclear.html

    I need the first box to expand with the content - this works fine in IE. I assumed it was a clearing the float problem, but I don't seem to be able to resolve it. I'm sure it something elementary but I can see the wood for trees due to looming deadline panic. (obviously the graphical elements will make it look a touch prettier!)

    I don't have ftp access where I am so it has to be geocities

    Cheers

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,355
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    You have set indexBody to a height of 140px but the content is greater than that so no amount of clearing will help. You need to use the min-height for good browers and a height for IE (see faq on min-height).

    Code:
    .indexBody,.indexFooter{
     width:265px;
     min-height:140px;
     margin:0;
     padding:0;
     border:1px solid;
    }
    * html .indexBody{ height:140px;}
    .indexFooter{
     clear:both;
     height:15px;
     min-height:15px;
    }
    Be aware that ie7 will probably also need the height declaration but it won't get it because it doesn't undersdtand the star selector hack (* html) therefore you may need to use conditional comments instead. (Or just wait until ie7 is here and then decide).

    Hope that helps.

  3. #3
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Of Course - THANK YOU - I'm an idiot, you most certainly are not!

    Thanks a million - I knew it would be something that was staring me in the face

  4. #4
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is this what you mean?

    <!--[if IE]>
    <style>
    .indexBody {
    height: 140px;
    }
    </style>
    <![endif]-->

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,355
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Yep that's it


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
  •