猿问

两个div 同行同高?????????????

我想让两个div在同一行并且高度相同希望大家多多帮忙!

我是这样做的

 <div  id="Holiday"  
            style=" margin-top:5px; margin-left:240px;height: 45px; width: 150px">
             <asp:Button ID="Button1" runat="server" Text="Button" /></div>
       <div  id="Div2"  
            style=" margin-top:-25px; margin-left:150px;height: 45px; width: 164px">
           <asp:Button ID="Button2" runat="server" Text="Button" />
       </div>

用的相对位置但是运行后Button1不能点击要是里面是textbox不能写文字其他控件也不行!


ABOUTYOU
浏览 546回答 2
2回答

慕码人8056858

<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <div id="Holiday" style="margin-left: 240px; height: 45px; width: 150px; float: left;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:Button ID="Button1" runat="server" Text="Button" /></div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <div id="Div2" style="margin-left: 150px; height: 45px; width: 164px; float: right;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:Button ID="Button2" runat="server" Text="Button" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </div>

猛跑小猪

<div id="Holiday" style="margin-top: 5px; height: 45px; width: 150px; float: left;"> &nbsp; &nbsp; &nbsp; &nbsp;<asp:Button ID="Button1" runat="server" Text="Button" /></div> &nbsp; &nbsp;<div id="Div2" style="margin-top: 5px; height: 45px; width: 164px; float: left;"> &nbsp; &nbsp; &nbsp; &nbsp;<asp:Button ID="Button2" runat="server" Text="Button" /> &nbsp; &nbsp;</div>
随时随地看视频慕课网APP
我要回答