2016-03-03 41 views
0

我使用表格屬性安排了主菜單導航。在li標籤中有錨標籤。並使用「after」方法提供錨標籤的下拉箭頭。現在我面臨的一個問題是,我的主播標記未採取其父母李全高其中顯示:表格單元格。而且我無法爲我的定位設置絕對位置,因爲我已經設置了位置:相對於其後的顯示箭頭。 我需要我的錨標籤來獲得全高的原因是。我的菜單可能有兩條線,如1. XXxxxxxxxx xxxxx 2.xxxxxx,所以第一條鏈接將由於沒有足夠的寬度而出現兩行。第二個將進入單線。孩子沒有采取表格單元父高度的標籤

ul.tb-megamenu-nav.nav{ 
    display: table; 
    width: 100%; 
    table-layout: fixed; 
    position: relative; 
} 

.tb-megamenu .nav > li.level-1 { 
    vertical-align: middle; 
    min-height: 48px; 
    float: none; 
    display: table-cell; 
    min-width: 16.56686626746507%; 
    position: static; 
    list-style: none; 
} 

.tb-megamenu .nav > li > a { 
    background-color: transparent; 
    padding: 8px 7%; 
    text-align: center; 
    color: #fff; 
    border: 0; 
    position: relative; 
    cursor: pointer; 
} 

.tb-megamenu .tb-megamenu-nav > li.dropdown > a:after { 
    content: ""; 
    width: 0; 
    height: 0; 
    position: absolute; 
    top: 40px; 
    left: 50%; 
    margin-left: -14px; 
    border-top: 14px solid #0092d0; 
    border-left: 14px solid transparent; 
    border-right: 14px solid transparent; 
    z-index: 999999; 

}

+1

您可以創建包括HTML片段? – silviagreen

回答

0

* { 
 
    outline: 1px solid blue; 
 
} 
 
ul.tb-megamenu-nav.nav { 
 
    display: table; 
 
    width: 100%; 
 
    table-layout: fixed; 
 
    position: relative; 
 
} 
 
.tb-megamenu .nav > li.level-1 { 
 
    vertical-align: middle; 
 
    min-height: 48px; 
 
    float: none; 
 
    display: table-cell; 
 
    min-width: 16.56686626746507%; 
 
    position: relative; 
 
    list-style: none; 
 
} 
 
.tb-megamenu .nav > li > a { 
 
    background-color: transparent; 
 
    padding: 8px 7%; 
 
    text-align: center; 
 
    color: #fff; 
 
    border: 0; 
 
    position: relative; 
 
    cursor: pointer; 
 
    display: block; 
 
} 
 
.tb-megamenu .tb-megamenu-nav > li.dropdown > a:after { 
 
    content: "➤"; 
 
    width: 0; 
 
    height: 0; 
 
    position: absolute; 
 
    top: 40px; 
 
    left: 50%; 
 
    margin-left: -14px; 
 
    border-top: 14px solid #0092d0; 
 
    border-left: 14px solid transparent; 
 
    border-right: 14px solid transparent; 
 
    z-index: 999999; 
 
}
<ul class="tb-megamenu-nav nav"> 
 
    <li class="level-1"></li> 
 
    <li class="dropdown"> 
 

 
    <a href='#'></a> 
 

 
    </li>

+0

謝謝@ zer00ne ..但我更新了我的問題plc check and help me out –

+0

我認爲我們需要一些HTML,我試圖猜測它看起來像什麼,但近距離的猜測只能算在馬蹄鐵和手榴彈中。 – zer00ne

相關問題