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
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>
精彩评论