开发者

A List in alphabetical order going down not across?

I have a giant list that comes out of my database in alphabetical order. It is placed in a Div with a set width. I have each

  • floated left and the are all next to each going from left to right and its great. BUT my client wants the order to go down not across. So it is like this:

    apple angry antler bone beard broken
    

    She wants:

    apple
    angry
    antler
    beard
    bone
    broken
    

    So if I do it this way I get a long list unless I make the height a set number, pushing the columns to the right, but then I run into the problem if the list grows and pushes out of the dimensions of the Div.

    Is it possible t开发者_开发问答o have a set height but once the list grows past the width it will push the height down ?


    Yes, you can use min-height, which is not supported by all browsers (IE6). I would however recommend using a fixed height and setting the overflow to auto. That way your div will have a scroll when the list grows, but it will not affect your design.

    <div style="height:200px; overflow: auto;">
        <ul>
            <li>apple</a>
            <li>angry</a>
            <li>antler</a>
            <li>...</a>
        </ul>
    </div>
    
  • 0

    上一篇:

    下一篇:

    精彩评论

    暂无评论...
    验证码 换一张
    取 消

    最新问答

    问答排行榜