Results 1 to 3 of 3

Thread: css li for 5 images in a row

  1. #1
    Join Date
    Jul 2006
    Posts
    64
    Thanks
    22
    Thanked 0 Times in 0 Posts

    Default css li for 5 images in a row

    I need to put 5 images in a row, can some give me an example or a generator site that will create the css code.

    thanks

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Images are inline elements so they will align in a row by default. If I didn't understand your request, please try to be more clear about it.

  3. #3
    Join Date
    Feb 2009
    Posts
    303
    Thanks
    18
    Thanked 36 Times in 36 Posts

    Default

    Snookerman's plan would work, or use this more complicated way:

    CSS:
    Code:
    .floating-img {
      float:left;
    }
    .clear-left {
      clear:left;
    }
    HTML:
    Code:
    <img src="some-img.jpg" alt="" class="floating-img" />
    <img src="some-img.jpg" alt="" class="floating-img" />
    <img src="some-img.jpg" alt="" class="floating-img" />
    <img src="some-img.jpg" alt="" class="floating-img" />
    <img src="some-img.jpg" alt="" class="floating-img" />
    <div class="clear-left"> </div>
    The "clear-left" is to stop other items from wrapping around it (if you didn't already know).

    Hope that helps!
    Alex Blackie, X96 Design
    My Website
    I specialize in: HTML5, CSS3, PHP, Ruby on Rails, MySQL, MongoDB, Linux Server Administration

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
  •