列表项高度在css中自动设置 [英] List Item Height auto set in css

查看:148
本文介绍了列表项高度在css中自动设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列表调用类别(高度为300px)。已经有5个项目。



所以我需要的是,如果我通过后端添加另一个类别项目,那么新项目应该自动设置为新的高度。 (参见示例清除更多)



示例:我有5个类别项目。列表高度为300px。因此,这种情况下每个列表项将高度设置为(300/5)60px。如果我添加新的类别项目,那么高度应设置为(300/6)50px。



我该如何管理? Plz帮助我。提前感谢。

I have a List call Category(height is 300px). There are already 5 Items on it.

So i need is, if i add another category item through backend, that new item should auto set to new height. (See the example to clear bit more)

Example : I have 5 category item. And List height is 300px. So this case each list item will set height as (300/5) 60px. If i add new category item then height should be set to (300/6) 50px.

how can i mange this?? Plz help me out. Thank in advance.

推荐答案

/*to prefent collapsed height list items*/
min-height : 300px;
/*to make height dynamic*/
height : auto;


这篇关于列表项高度在css中自动设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆