CSS填充继续继承 [英] CSS padding keeps inheriting

查看:136
本文介绍了CSS填充继续继承的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做一个下拉菜单,但是第一个ul的所有样式都被添加到第一个ul下面每个ul的样式。

I'm making a dropdown menu, but all the styles from the first ul is being added to the styles on every ul beneath the first ul.

ve尝试重写风格使用!important,并将css移动到不同的级别。
任何人都知道这里发生了什么?

I've tried overriding the styles using !important, and moving the css to different levels. Anyone got a clue about whats going on here?

这个图像probaly解释了它的最佳方式: http://screencast.com/t/UrkRbjjaYctp

This image probaly explains it the best way: http://screencast.com/t/UrkRbjjaYctp

感谢。

推荐答案

#menuwrapper > ul{
padding-left:37px;
}
#menuwrapper ul ul {
padding-left:40px;
}

这应该可以解决您的问题

This should solve your issue

这篇关于CSS填充继续继承的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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