SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    May 2007
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS DIV Layout problem

    Hi all

    Not quite sure what is happening with my css but I have created a div that holds an image and text from a database. This is done by a php while loop.

    There is not a problem in Firefox but in IE the DIV's start coming out of line with one another and sometimes putting big gaps in the content area where there shouldn't be. I can't see what the problme is when all the php is doing is lopping the same DIV for each peice of data in the Database.

    Can anyone help?

    Here is the page
    http://www.istl.com/css/drivers.php

    Thanks

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

    I couldn't see evidence of a problem on that page, Therefore I'm guessing that the problem is that some of your captions are running to 2 lines and making some of those floats higher than the others.

    If this is the case then when the floats wrap to another line they will snag on the tallest float and the layout will go all out of sync. You need to set a height that will accommodate your longest caption and apply that to all floats or else crop the captions to one line if possible.

    There is a very complicated example here that allows for any length of caption.

    If that's not the problem then a link to a page showing what you mean would be helpful

    BTW you need to clear the floats in firefox to make the background extend around them.
    Last edited by Paul O'B; Oct 17, 2007 at 04:51.


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
  •