如何将两个div并列排在同一行

时间:2013.10.30 发布人:6d1d7i9o1

如何将两个div并列排在同一行

已解决问题

谷歌6d1d7i9o1用户在2013.10.30提交了关于“楚氏春秋如何将两个div并列排在同一行”的提问,欢迎大家涌跃发表自己的观点。目前共有1个回答,最后更新于2024-09-18T00:25:50。这是两个div的CSS:
#left{
width:131px;
height:311px;
position:relative;
left:3**x;
top:21**x;
}
#biaodan{
width:340px;
height:222px;
position:relative;
left:322px;
top:21**x;
float:inherit;
}

这是div:
<divid="login">
<divid="left">
<tablecellpadding="0"cellspacing="0"border="0;">
<tr>
<td><imgsrc="images/login3_r4_c2.gif"/></td>
</tr>
<tr>
<td><imgsrc="images/login3_r5_c2.gif"/></td>
</tr>
<tr>
<td><imgsrc="images/login3_r6_c2.gif"/></td>
</tr>
</table>
</div>
<divid="biaodan">
<tablewidth="340"height="222"class="shuru"border="1"cellpadding="0"cellspacing="0">
<tr>
<td>Email地址</td>
<td><inputtype="text"id="search_1"class="search_box"/></td>
</tr>
<tr>
<td>登陆密码</td>
<td><inputtype="text"id="search_2"class="search_box"/></td>
</tr>
<tr>
<td>确认密码</td>
<td><inputtype="text"id="search_3"class="search_box"/></td>
</tr>
<tr>
<td>验码</td>
<td><inputtype="text"id="search_4"class="search_box"/></td>
</tr>
</table>
</div>
</div>希望大家能够帮助她。

详细问题描述及疑问:这是两个div的CSS:
#left{
width:131px;
height:311px;
position:relative;
left:3**x;
top:21**x;
}
#biaodan{
width:340px;
height:222px;
position:relative;
left:322px;
top:21**x;
float:inherit;
}

这是div:
<divid="login">
<divid="left">
<tablecellpadding="0"cellspacing="0"border="0;">
<tr>
<td><imgsrc="images/login3_r4_c2.gif"/></td>
</tr>
<tr>
<td><imgsrc="images/login3_r5_c2.gif"/></td>
</tr>
<tr>
<td><imgsrc="images/login3_r6_c2.gif"/></td>
</tr>
</table>
</div>
<divid="biaodan">
<tablewidth="340"height="222"class="shuru"border="1"cellpadding="0"cellspacing="0">
<tr>
<td>Email地址</td>
<td><inputtype="text"id="search_1"class="search_box"/></td>
</tr>
<tr>
<td>登陆密码</td>
<td><inputtype="text"id="search_2"class="search_box"/></td>
</tr>
<tr>
<td>确认密码</td>
<td><inputtype="text"id="search_3"class="search_box"/></td>
</tr>
<tr>
<td>验码</td>
<td><inputtype="text"id="search_4"class="search_box"/></td>
</tr>
</table>
</div>
</div>期待您的答案,没有什么华丽的语言,但是我对你的感谢不会减少 !

希望以下的回答,能够帮助你。

第1个回答

用户名:chenyanfang914  

使用css的float样式就守西每重服都星苦烧激完可以实现将DIV并列排在同一行,代码如下:

<style>
.box1{width:100px;float:left;display:inline;border专团错联小既织:red1pxsolid;}
.box2{width:100px;float:left;disp问答lay:inline;border:green1pxsolid板务设富乱善;}
</style>
<divclass="container">
<divclass="box1">121212</d伯置纪红还评果生iv>
<divclass="box2">455656</div>
</div>

果如下:

相关说明:

float属性定义元素在哪个方向浮动。

可能的值

值描述

left元素向左浮动。

right元素向右浮动。

none默认值。元素不浮动,并会显示在其在文本**现的位置

inherit规定应该从父元素继承float属性的值。