简体   繁体   English

div定位不正确-CSS问题

[英]Div not positioning as it should - CSS problem

I'm working on a joomla site and customizing the template for the client. 我正在一个joomla网站上,并为客户端自定义模板。 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. 好的,让我解释一下:我有一个HTML来加载菜单,然后放一个空的div(用于clearfix),然后为下一个元素打开另一个div。

(I'm having issues with the code parser on Stack overflow So I'm posting the code to pastie and linking from here.) (我在堆栈溢出时遇到代码解析器问题,所以我将代码发布到Pastie并从此处链接。)

Ok so I have this html and this css 好的,所以我有这个HTML和这个CSS

now as I see it, normally, the wrapper_menu should have at least 130px height (min-height property) and grow if needed. 现在,正如我所见,通常,wrapper_menu的高度至少应为130px(最小高度属性),并在需要时增大。 then the .clr clears the float, and the next element , since its a div should be put under it. 然后,.clr清除浮点数和下一个元素,因为应在其下面放置一个div。 So AFTER the menu_wrapper content. 因此,在menu_wrapper内容之后。 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). 事实并非如此,menu_wrapper的高度始终为130px,并且当其增长时,whitebox元素将位于其顶部(尽管文本仍然可见,但不可单击)。 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. 我真的不知道还可以尝试什么来使此菜单的div与内容一起增长。

thanks 谢谢

Cromestant. rom脚

You are using position: absolute; 您正在使用position: absolute; on ul.menu which is taking out the ul from the document flow. ul.menu ,该ul.menu将从文档流中取出ul。 Remove it and it will look much better. 删除它,它将看起来更好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM