【发布时间】:2013-12-27 07:21:57
【问题描述】:
我正在尝试在主 <div> 中使用两个 <div> 元素。但问题是,在第一个<div> 中,我使用了<image> 控件,并且我正在从数据库中获取一些文本数据。在第二个<div> 中,我使用的是<gridview>。但我无法在同一行水平显示这两个<div> 元素。
我试过这样做:
<div style="width:1000px;overflow:hidden; height:auto; float:left; text-align:justify; margin-bottom:15px;">
<div id="right part" runat="server" style="width:auto; float:left; margin:0 12px 12px 0;">
<asp:Image ID="Image1" runat="server" Height="122px" Width="148px" /><% =details %></div>
<div id="left part" runat="server" style="float:left;width:auto;display:inline-block;">
<asp:GridView ID="GridView1" runat="server" ShowHeader="False"
ForeColor="Black" GridLines="None" EnableModelValidation="True"
onpageindexchanging="GridView1_PageIndexChanging" onrowcreated="GridView1_RowCreated">
</asp:GridView>
</div>
</div>
如果我做错了什么,请建议我?
【问题讨论】:
-
尝试将 width:auto 更改为 width:50%;
-
将 float:right; 设置为第二个 div