Tuesday, 15 April 2014

html - CSS Rendering List Items in 2 rows -


Assume that I have

  • elements that are designed to render through float: a fixed The width is left inside the container:

      item 1 | Item 2 | Item 3 | Item 4 Item 5 | Item 6  

    It's okay, item 5 and item 6 are pushing in the second row because the container has a fixed width.

    Now, is it possible something like the above, except that most items will render in the second row? Something like this:

      Item 1 | Item 2 | Item 3 | Item 4 Item 5 | Item 6  

    Actually, I want to present a list of objects horizontally, wrap it in the second line as needed, but if with most items on the second line is present. The number of items that may arise may vary, but can not exceed values ​​of 2 rows.

  • Without a manually defined item that starts with the new line (clear: both;) , Or using Javascript to find out which items should be broken, and similar to the above.


    No comments:

    Post a Comment