日期:2014-05-18  浏览次数:20677 次

请问如何让两个div在同一行内底边对齐???
我这里有两个div,logo放在页面的左边,只是一张图片。menu放在右边,只是一行文字。

<div   id= "header ">
    <div   id= "logo "> <img   src= "top_logo.gif "   width= "181 "   height= "80 "   /> </div>
    <div   id= "menu "> 此处显示     id   "menu "   的内容 </div>
</div>

css代码如下:
#header{
clear:both;
margin:0px   auto;
width:800px;
}

#logo{
float:left;
}

#menu{
float:right;
}

现在的问题是,logo和menu在同一行,但是两个div默认是沿顶边对齐,我想让他们靠底,应该怎么做呢???

------解决方案--------------------

margin-bottom:0px;
bottom:0px;
------解决方案--------------------
简单实现,快快结帖.

<style type= "text/css ">
#header{
clear:both;
margin:0px auto;
width:800px;
position: relative;
}

#logo{
float:left;
}

#menu{
float:right;
position: absolute;
bottom:0px;
}
</style>
<div id= "header ">
<div id= "logo "> <img src= "top_logo.gif " width= "181 " height= "80 " /> </div>
<div id= "menu "> 此处显示 id "menu " 的内容 </div>
</div>
------解决方案--------------------
<div id= "logo "> <img src= "top_logo.gif " width= "181 " height= "80 " align= "absbottom " /> </div>

------解决方案--------------------
两div高度设置一样的
------解决方案--------------------
margin-bottom:0px;
bottom:0px;

------解决方案--------------------
不行就設置maring-top;
------解决方案--------------------
<div id= "head " style= "width:776px; height:100px; ">
<div id= "H_Left " style= "float:left; width:120px; margin:0px;height:100px ">
左边logo </div>
<div id= "H_Right " style= "float:right;width:656px margin:0px; "> 右边没试过,应该可以. </div>

</div>
------解决方案--------------------
你用padding或者margin 一点一点的调咯
------解决方案--------------------
方法就是不要把img放到另一个DIV中,直接设置img的style的float,并且设置img的align属性为absmiddle
------解决方案--------------------
放在一个table里面啊