Div 没有按应有的方式定位 - CSS 问题
我正在开发一个 joomla 网站并为客户定制模板。 首先我要说的是,我不擅长让事情变得“美丽”,但我尝试、测试和研究了很多,我还没有找到这不起作用的原因。
好吧,让我解释一下: 我有这个 HTML,它加载菜单,然后放置一个空的 div(用于clearfix),然后为下一个元素打开另一个 div。
(我在堆栈溢出时遇到代码解析器问题,因此我将代码发布到 Pastie 并从此处链接。)
现在,据我所知,通常,wrapper_menu 应该在至少 130px 高度(min-height 属性)并根据需要增长。然后 .clr 清除 float 和下一个 element ,因为它的 div 应该放在它下面。所以在 menu_wrapper 内容之后。 事实并非如此,menu_wrapper 的高度始终为 130px,当它增大时,whitebox 元素会位于其上方(尽管文本仍然可见,但不可单击)。 我尝试将溢出自动放在包装器上,但它仍然位于顶部,但不再看到文本。 你可以在这里查看测试网站
我真的不知道还能尝试什么才能获得这个菜单的div与内容一起成长。
谢谢克罗
美坦。
I'm working on a joomla site and customizing the template for the client.
First of all let me say this, I suck at getting things to be "beautiful" but I try, test and research a lot, I have not found the reason for this not working.
Ok let me explain:
I have this HTML that loads the menu and then puts an empty div (for clearfix) and then opens another div for the next element.
(I'm having issues with the code parser on Stack overflow So I'm posting the code to pastie and linking from here.)
Ok so I have this html and this css
now as I see it, normally, the wrapper_menu should have at least 130px height (min-height property) and grow if needed. then the .clr clears the float, and the next element , since its a div should be put under it. So AFTER the menu_wrapper content.
It does not, the menu_wrapper is always 130px height, and when it grows, the whitebox element gets on top of it ( although the text is still visible, but not clickable).
I tried putting overflow auto on the wrapper and still it gets on top but the text is no longer seen.
you can see the test site here
I really don't know what else to try in order to get this menu's div to grow with the content.
thanks
Cromestant.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在
ul.menu
上使用position:absolute;
,它从文档流中取出 ul。把它去掉,看起来会好很多。You are using
position: absolute;
onul.menu
which is taking out the ul from the document flow. Remove it and it will look much better.