4

Is there any solution for my problem, described in this image?

http://i.imgur.com/6uhxlNm.png

I have a DIV-tag with a fixed height. In this element, i have a List. This List should be floated like columns. The list-elements have a fixed width. if there are "too much" elements in the Div-Tag, it should scroll horizontally. The amount of columns and elements is not fix. It should also work in old Browsers.

Is there any solution with HTML/CSS?

4
  • Have a play with the display (CSS). Apr 2, 2013 at 16:05
  • 2
    Please post up what code (if any) that you have tried so far.
    – Billy Moat
    Apr 2, 2013 at 16:05
  • 1
    Interesting :) I've created a fiddle - jsfiddle.net/y93pZ for anyone to use since I'm wondering if this is possible with CSS only.
    – Kaloyan
    Apr 2, 2013 at 16:13
  • Are the list-elements fixed height? Can you add containers? Because then floating them (or inline-block) is enough
    – FelipeAls
    Apr 2, 2013 at 16:34

1 Answer 1

9

You can use columns and related CSS3 properties:

Here is fiddle: http://jsfiddle.net/DeLL7/5/

Updated for for non-fixed number of columns and fixed container height. However, for older browsers, you're probably out of luck, without having to "manually" arrange the boxes.

4

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.