我试过这个:
<div id="xDiv" align="left">
<div id="divX" runat="server" style="margin-left:40px; width: 650px;"
align="center">
<asp:Menu ID="Menu3" runat="server" Orientation="Horizontal" Width="100%"
StaticSelectedStyle-CssClass="StaticSelectedStyle" Height="52px"
StaticSubMenuIndent="18px" oninit="Menu3_Init">
<StaticSelectedStyle CssClass="StaticSelectedStyle"></StaticSelectedStyle>
<Items>
<asp:MenuItem Text="Test" />
</Items>
</asp:Menu>
</div>
<div runat="server">
<asp:DropDownList ID="DropDownList3" runat="server"
DataSourceID="SqlDataSource1" DataTextField="RepGroup_Name"
DataValueField="RepGroup_ID" Width="162px">
</asp:DropDownList>
</div>
</div>
但是它将DropDownList放在行尾,它将它放在一个新行上。
答案 0 :(得分:4)
您需要一个简单的Css类,如下所示:
.Menu
{
display: inline-block;
}
<asp:Menu ID="Menu1" runat="server" CssClass="Menu" />
<asp:DropDownList ID="DropDownList1" runat="server" />
<强>更新强>
<div id="xDiv" align="left">
<div id="divX" runat="server" style="margin-left: 40px; width: 650px; float: left;" align="center">
<asp:Menu ID="Menu3" runat="server" Orientation="Horizontal" Width="100%" StaticSelectedStyle-CssClass="StaticSelectedStyle"
Height="52px" StaticSubMenuIndent="18px">
<StaticSelectedStyle CssClass="StaticSelectedStyle"></StaticSelectedStyle>
<Items>
<asp:MenuItem Text="Test" />
</Items>
</asp:Menu>
</div>
<div id="Div1" runat="server" style="float: left;">
<asp:DropDownList ID="DropDownList3" runat="server" Width="162px">
<asp:ListItem Text="Item1" Value="Item1" />
</asp:DropDownList>
</div>
</div>