为什么下拉列表显示在div下面

时间:2014-09-30 14:51:46

标签: html css asp.net drop-down-menu

我有以下ASP.net代码,它是向用户显示的弹出窗口:

<div id="popupContact">
    <a id="popupContactClose" title="Close Window">x</a>
    <h3>Add a New Message</h3>
    <div id="dvFirst" class="mainSecond">
        <div id="leftdiv3" class="leftdiv">Client: </div>
        <div id="rightdiv3" class="rightdiv" style="z-index: 100;"><asp:DropDownList ID="ddlCliNewMsg" AutoPostBack="false" ClientIDMode="Static" runat="server" CssClass="chosen-select" ></asp:DropDownList></div>
    </div>
    <div id="dvSecond" class="mainSecond">
        <div id="leftdiv4" class="leftdiv">Location: </div>
        <div id="rightdiv4" class="rightdiv" style="z-index: 100;"><asp:DropDownList ID="ddlSitNewMsg" AutoPostBack="false" ClientIDMode="Static" runat="server" CssClass="chosen-select"></asp:DropDownList></div>
    </div>
    <div id="dvSixth" class="mainSecond">
        <div id="leftdiv6" class="leftdiv">Specialty: </div>
        <div id="rightdiv6" class="rightdiv" style="z-index: 100;"><asp:DropDownList ID="ddlPraNewMsg" AutoPostBack="false" ClientIDMode="Static" runat="server" CssClass="chosen-select"></asp:DropDownList></div>
   </div>
   <div id="dvThird" class="mainSecond">
        <div id="leftdiv5" class="leftdiv">Provider: </div>
        <div id="rightdiv5" class="rightdiv" style="z-index: 100;"><asp:DropDownList ID="ddlProNewMsg" AutoPostBack="false" ClientIDMode="Static" runat="server" CssClass="chosen-select"></asp:DropDownList></div>
    </div>
    <div id="dvFourth" class="mainFirst">
        <div id="leftdiv1" class="leftdivspec"><sup style="color: #FF0000; font-weight: bold;">*</sup>Message: </div>
        <div id="rightdiv1" class="rightdivspec"><asp:TextBox ID="tbMessage" ClientIDMode="Static" runat="server" TextMode="MultiLine" Columns="30" Rows="5"></asp:TextBox></div>
    </div>
    <div id="dvFifth" class="mainSecond">
        <div id="leftdiv2" class="leftdiv">Active?</div>
        <div id="rightdiv2" class="rightdiv"><asp:CheckBox ID="cbIsActive" ClientIDMode="Static" runat="server" /></div>
    </div>
    <div style="width: 96%; text-align: right; padding: 2%;">
        <asp:UpdatePanel runat="server" ID="upSubmit" ClientIDMode="Static" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:Button ID="btnSubmit" runat="server" Text="Submit" CssClass="btnSubmit" ClientIDMode="Static" UseSubmitBehavior="false" OnClick="SubmitAdminMessage" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</div>

CSS:

.mainFirst
{
    width: 95%;
    margin: auto;
    padding: 1%;
    height: 90px;
    border-bottom: 1px dotted #808080;
}
.mainSecond
{
    width: 95%;
    margin: auto;
    padding: 1%;
    height: 30px;
    border-bottom: 1px dotted #808080;
    overflow: hidden;
}
.leftdiv
{
    width: 35%;
    height: 30px;
    float: left;
    font-weight: bold;
}
.rightdiv
{
    width: 65%;
    height: 30px;
    float: left;
}

最初加载弹出窗口时,它显示如下:

enter image description here

每当我从下拉列表中选择一些东西时,它都会在它下面的DIV下面:

enter image description here

如何修改CSS以使每个DropDownList出现在容器之外,以便显示选项?

1 个答案:

答案 0 :(得分:1)

你可以尝试添加&#34;溢出:可见&#34;到容器类