为什么ul元素没有高度? [英] Why do the ul elements have no height?

查看:170
本文介绍了为什么ul元素没有高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚为什么左侧导航栏上的ul元素
在此网站上的高度为零。



抱歉,这是一个很容易的错误,li元素在哪里设置为显示内联。



我用 float:left;



解决方案(简而言之):从<$ c中删除浮动属性$ c> li 元素有任何


I'm trying to working out why the ul elements on the left nav on this site have a height of zero.

I'd like to add a bottom margin to the nested ul...

解决方案

Sorry, it was a easy error in the end, the li elements where set to display inline.

I did override this rule with float:left; clear:left which resulted in the ul elements having no height.

Solution (in short): remove the floating attribute from the li elements it has any

这篇关于为什么ul元素没有高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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