我的下拉菜单被Angular中的部分模板隐藏

时间:2016-09-13 15:04:42

标签: html css angularjs

我能够使用三个部分模板构建我的第一个兽医Angular应用程序,并使用教程和SO社区的精彩反馈创建一个下拉菜单,所以我非常高兴! :)

简介页面:

enter image description here

但是,当我选择"员工"时,我会得到阻止下拉菜单的胡须盒图:

enter image description here

我认为这是CSS的问题,但我已经停留了很长一段时间,并且非常感谢社区的反馈。

此外,如果我可能会问,我怎么能在最右边的菜单按钮,与topBanner相同的高度,下拉菜单与右边缘对齐(而不是如图所示的左边缘)?非常感谢你!

我的网络形式:

...
<body onload="loadPikaday()" data-ng-app="myModule">

    <%-- Header --%>
    <div id="topBanner" class="topBanner">
        <div id="menu" class="menu">
            Report from: &emsp; 
            <input id="startDate" size="6" type="text" data-ng-model="startDate" /> &emsp; To &emsp; 
            <input id="endDate" size="6" type="text" data-ng-model="endDate" />&emsp; 

           <%-- Dropdown menu --%>
            <div class="dropdown">
            <button onclick="myFunction()" class="dropbtn">MENU</button>
                <div id="myDropdown" class="dropdown-content">
                    <a href="#/cases">Cases</a>
                    <a href="#/protocols">Protocols</a>
                    <a href="#/employees">Employees</a>
                </div>
            </div>
        </div>
</div>

    <%-- Where html is injected--%>
    <div id="currentPage" class="currentPage">
        <div data-ng-view=""></div>
    </div>

    <%-- Footer  --%>
    <div id="footer" class="footer">Veterinary Application</div>
</body>
...

我的CSS文件:

body,html{ 
   margin: 0;
   padding: 0;
}

.topBanner{
    width: 100%;
    background-color: #BDBDBD;
}

.menu{
    text-align: left; 
    font-size: 40px;
    font-family: Arial;
    padding-bottom:5px;
    padding-top:5px;
}

#startDate, #endDate{
    font-size: 40px;
}

#button{
    font-size: 40px;
}

.currentPage{
    background-color: #E6E6E6;
    width: 100%;
}
.footer{
    font-size: 30px;
    font-family: Arial;
    background-color: #BDBDBD;
    text-align: center; 
}

.dropbtn {
    background-color: #4CAF50;
    color: white;
    padding: 16px;
    font-size: 16px;
    border: none;
    cursor: pointer;
}

.dropbtn:hover, .dropbtn:focus {
    background-color: #3e8e41;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    overflow: auto;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown a:hover {background-color: #f1f1f1}

.show {display:block;}

0 个答案:

没有答案
相关问题