我創建了一個名爲NetWeight的asp.net應用程序,我的下拉菜單和子菜單放置不正確,其中一些放置正確,其他人共同在一起。我的下拉菜單和子菜單沒有正確放置在瀏覽器中
我已創建我的情況小提琴請幫我:
http://jsfiddle.net/debatechamp/nv93vahq/
,你可以看到,如果你將鼠標懸停在MasterData標籤的所有菜單的井然有序,但標籤旁邊,產品重量數據表打印一個項目並打印所有項目的子菜單彼此重合,我甚至無法在沒有塊互相打斷的情況下重疊項目。
這裏是CSS
/* DropDown Styling */
.menu ul li:hover ul li a {background-image: none; display:block;height: 28px; line-height: 26px; color:#381B01; width:142px; text-align:left; margin: 0; padding:0 0 0 11px;font-weight:normal;}
.menu ul li:hover ul {
margin: 0 0 0 3px;
padding: 0;
background-image:url('http://i.imgur.com/cAxTTkk.png');
background-repeat:no-repeat;
background-position:bottom left;
}
/* DropDown Menus ":active" or "Selected" Styling */
.menu ul li:hover ul .sub_active {
background-image:url('http://i.imgur.com/Npx66xl.png');
margin-right: 1px;
}
/* DropDown Menus ":hover" Styling */
.menu ul li:hover ul li a:hover {color:#381B01 !important; background-image:url('http://i.imgur.com/TwDd5GH.png');}
.menu ul li:hover ul li:hover ul {display:block; position:absolute; left:105px; top:0;}
.menu ul li:hover ul li:hover ul.left {left:-105px;}
.wrap{
position:relative;
top:32px;
left:-10px;
float:left;
width:1647px;
height:829px;
background:#3A1C01 url('images/presentation/caramel-cream.png') no-repeat center 120px;
border:3px solid #f0f0f0;
padding-left:10px;
margin-right: 0px;
padding-right: 0;
padding-top: 0;
padding-bottom: 0;
}
.dropdown-submenu {
position: absolute;
margin-left: 10px;
display:block
}
.dropdown-menu .sub-menu {
left: 100%;
position: absolute;
top: 0;
display:none;
margin-top: -1px;
border-left-color:#fff;
margin-left: 10px;
}
.dropdown-submenu:hover>.dropdown-menu {
display: block;
}
.dropdown-submenu>a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: green;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #ccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover>a:after {
border-left-color: #fff;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left>.dropdown-menu {
left: 180px;
margin-left: 10px;
-webkit-border-radius: 6px 0 6px 6px;
-moz-border-radius: 6px 0 6px 6px;
}
的HTML代碼
<ul>
<li class="dropdown-menu">
<a tabindex = "-1" >Print One Item</a>
<ul class = "dropdown-submenu">
<li><a tabindex = "-1" href = "PrintOneBag.aspx" >Bag</a></li>
<li><a tabindex = "-1" href = "PrintOneBar.aspx">Bar</a></li>
<li><a tabindex = "-1" href = "PrintOneSapal.aspx">Sapal</a></li>
<li><a tabindex = "-1" href = "PrintOneHandPack.aspx">Hand Pack</a></li>
</ul>
</li>
<li class="dropdown-menu">
<a tabindex = "-1">Print All Items</a>
<ul class = "dropdown-submenu">
<li><a tabindex = "-1" href = "AllBag.aspx">Bag</a></li>
<li><a tabindex = "-1" href = "AllBar.aspx">Bar</a></li>
<li><a tabindex = "-1" href = "PrintAllSapal.aspx">Sapal</a></li>
<li><a tabindex = "-1" href = "PrintAllHandPack.aspx">Hand Pack</a></li>
</ul>
感謝提前任何幫助,你的幫助是非常讚賞,因爲我並不擅長的CSS/HTML
我不知道你在說什麼關於。你的小提琴看起來不錯。兩個菜單項「PrintOneItem」和「PrintAllItems」看起來像第一個列表一樣堆疊。我錯過了什麼嗎? – stripathi 2015-03-13 19:59:41
@stripathi如果看看他們的子菜單盒打印一個包,打印一個條,然後打印所有的下拉菜單,你有所有的包,所有的酒吧,如果我從打印一個鼠標懸停在打印一個吧自動去所有袋子 – HackMaster 2015-03-13 20:46:45