2012-07-04 271 views
0

试图浮动留下一个UL和一个UL权的底部,并将其保持到DIV的底部,但没有成功对齐浮动元素DIV

继承人的小提琴http://jsfiddle.net/Ku2jk/

+0

你有4个DIV :)哪一个? '菜单'?顺便说一句:'backgroundcolor'是无效的CSS。和'height ='也是无效的。应该是:'background:'或'background-color'和'height:100px;' –

+0

对不起,输入起来应该已经很快测试了吧 – davey

回答

0

没有错的办法飘起了位于另一个容器内的容器,位于绝对底部。

你只是有一些语法错误加上持有浮动div的容器没有宽度。

http://jsfiddle.net/Ku2jk/26/

height = 100px; 
    ^ should be height:100px; 
backgroundcolor: blue; 
     ^should be background-color; 


#menubar{ 
    position: absolute; 
    bottom: 0; 
    width: 100%; 
    ^ needed a width because positioned absolute. 
} 
+0

我是否指定了一个确切的宽度,是否没有办法从容器中继承宽度? – davey

+0

我曾使用确切的宽度工作,但我试图根据浏览器大小调整网站 – davey

0

其中的DIV?尝试从#menubar删除position: absolute。另外,更改backgroundcolor,即不存在background-colorbackground