2016-09-30 84 views
1

網站鏈接是:http://mattarlaw.com/ar 我正在使用多語言網站。問題是使用阿拉伯語,這是一種從右向左的語言。 導航菜單未與每個父項目的右下角對齊。 懸停時出現導航菜單。 下面的圖片說明了這個問題,我想達到的效果: A sample of the problem將導航菜單與其父項對齊

header nav{ 
 
     clear: both; 
 
     margin-left: 0px; 
 
     float: right; 
 
     } 
 
     
 

 
      .mean-nav .arMenu { 
 
     \t color: #fff; 
 
     \t text-align: right; 
 
     } 
 
     header nav ul{ 
 
     margin: 0; 
 
     padding: 0; 
 
     list-style: none; 
 
     } 
 
      
 
     header nav ul li{ 
 
     float: right; 
 
     margin: 0px 5px; 
 
     position: relative; 
 
     padding: 0; 
 
     } 
 
     
 
     header nav ul li a{ 
 
     text-align: center; 
 
     width: 100%; 
 
     padding: 6px; 
 
     display: block; 
 
     text-decoration: none; 
 
     font-size: 13px; 
 
     color: #8a191b; 
 
     transition: ease-in-out all .2s; 
 
     -moz-transition: ease-in-out all .2s; 
 
     -webkit-transition: ease-in-out all .2s; 
 
     } 
 
      
 
     header nav ul li a:hover{ 
 
     color: #000; 
 
     transition: ease-in-out all .2s; 
 
     -moz-transition: ease-in-out all .2s; 
 
     -webkit-transition: ease-in-out all .2s; 
 
     text-decoration: none; 
 
     } 
 
      
 
      
 
     header nav ul ul { /* this targets all sub main-navs */ 
 
     display: none; /* hide all sub main-navs from view */ 
 
     position: absolute; 
 
     z-index: 9999; 
 
     padding-top: 14px; 
 
     margin: 0; 
 
     margin-left: 0; 
 
     padding-left: 0; 
 
     
 
     } 
 
      
 
     
 
     header nav ul ul li { /* this targets all submain-nav items */ 
 
     width: auto; /* set to the width you want your sub main-navs to be. This needs to match the value we set below */ 
 
     float: none; 
 
     /*min-width: 100px; */ 
 
     white-space: nowrap; 
 
     margin: 0; 
 
     padding: 0; 
 
     display: block; 
 
     border-bottom: 1px solid #fff; 
 
     } 
 
     
 
     header nav ul ul li a { 
 
     font-size: 12px; 
 
     font-weight: normal; 
 
     color: #fff; 
 
     text-align: right; 
 
     height: 26px; 
 
     line-height: 26px; 
 
     background-image: none; 
 
     text-decoration: none; 
 
     border: 0; 
 
     padding: 0px 5px; 
 
     background: #8a191b; 
 
     opacity: 1; 
 
     border: none; 
 
     box-shadow: none; 
 
     }
<div class="nav"> 
 
\t <header> 
 
\t \t <nav> 
 
\t \t \t <ul id="menu-header" class="menu"> 
 
\t \t \t \t <li id="menu-item-776" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-776"> 
 
\t \t \t \t \t <a href="http://mattarlaw.com/ar/%d8%a7%d9%84%d9%85%d9%83%d8%aa%d8%a8/"> 
 
\t \t \t \t \t \t <div class="arMenu">المكتب</div> 
 
\t \t \t \t \t </a> 
 
\t \t \t \t \t <ul class="sub-menu"> 
 
\t \t \t \t \t \t <li id="menu-item-105" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-105"><a href="http://mattarlaw.com/ar/%d9%85%d8%ad%d8%a7%d9%85%d9%88%d9%86-%d9%81%d9%8a-%d9%84%d8%a8%d9%86%d8%a7%d9%86-%d8%aa%d8%b9%d8%b1%d9%8a%d9%81/">من نحن</a></li> 
 
\t \t \t \t \t \t <li id="menu-item-109" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-109"><a href="http://mattarlaw.com/ar/%d9%85%d8%ad%d8%a7%d9%85%d9%8a-%d9%84%d8%a8%d9%86%d8%a7%d9%86-%d9%85%d8%a8%d8%a7%d8%af%d8%a4%d9%86%d8%a7/">مبادؤنا</a></li> 
 
\t \t \t \t \t \t <li id="menu-item-113" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-113"><a href="http://mattarlaw.com/ar/%d9%85%d8%ad%d8%a7%d9%85%d9%88%d9%86-%d9%84%d8%a8%d9%86%d8%a7%d9%86-%d8%a7%d9%84%d9%82%d8%b6%d8%a7%d9%8a%d8%a7/">القضايا</a></li> 
 
\t \t \t \t \t \t <li id="menu-item-118" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-118"><a href="http://mattarlaw.com/ar/nominations-awards/">الجوائز والتسميات</a></li> 
 
\t \t \t \t \t </ul> 
 
\t \t \t \t </li> 
 
\t \t \t </ul> 
 
\t \t </nav> 
 
\t </header> 
 
</div>

感謝

+0

你能粘貼你的HTML以及? – RasmusGlenvig

+0

剛剛粘貼html – TooFast

+0

ul.sub-menu {right:5px;} – channasmcs

回答

2

newtheme_arab.css做到這一點:

header nav ul ul { 
    display: none; 
    position: absolute; 
    z-index: 9999; 
    //padding-top: 14px; remove this line 
    margin: 0; 
    margin-left: 0; 
    padding-left: 0; 
    right: 5px; //add this line 
} 
+0

謝謝Mostafa!正確的我所需要的。爲我工作就像一個魅力 – TooFast