SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    May 2012
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Issue with Floats on my Index page.

    I'm trying to get my image thubnails on my index page to float left - 3 across at 300px width on my site: http://craigmurray.virb.com/work

    Right now, there seems to be some odd glitch not allowing me to do this. The parent container for the index is 960px wide, so the math should work out giving me an even 30px margin between each thumbnail.

    Here is what I have currently. Why doesn't this get me 3 across?:

    Code:
    #index ul.thumbs li {
      width: 300px;
      height: 225px;
      margin: 0 30px 30px 0;
      float: left;
    }
    
    #index ul.thumbs li img {
      width: 300px;
    }
    Thanks for any insight/help to resolve.

  2. #2
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,833
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    Try validating yoir pages, remove all errors and only declare an ID once or make the ID into a CLASS

    http://validator.w3.org/check?uri=ht...Inline&group=0
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Patche on earning Member of the Month for July 2014

  3. #3
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,177
    Mentioned
    264 Post(s)
    Tagged
    5 Thread(s)
    I think your problem lies here:

    Code:
    #index ul.thumbs li {
        float: left;
        height: 225px;
        margin: 0 30px 30px 0;
        width: 300px;
    }
    You've added 30px right margin to each of those items, so 3 x 330 = 990, which won't fit.

    As John says, validating your code would also be a good idea.


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
  •