我正在使用 WordPress
我在导航菜单中放了一个额外的容器。导航菜单的 ID 为 #access,额外的容器的 ID 为 #language-selection 。#language-selection 容器使用<li>
元素,但悬停和焦点被以下内容覆盖:
#access li:hover > a,
#access ul ul :hover > a,
#access a:focus {
background: #efefef;
}
#access li:hover > a,
#access a:focus {
background: #f9f9f9; /* Show a solid color for older browsers */
background: -moz-linear-gradient(#f9f9f9, #e5e5e5);
background: -o-linear-gradient(#f9f9f9, #e5e5e5);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f9f9f9), to(#e5e5e5)); /* Older webkit syntax */
background: -webkit-linear-gradient(#f9f9f9, #e5e5e5);
color: #373737;
}
我怎样才能覆盖这些规则,以便当它在#access 容器内时,悬停和专注于#language-selection 容器时不会发生任何事情?
以下是 HTML:
<nav id="access" role="navigation">
<h3 class="assistive-text">Main menu</h3>
<div class="skip-link">
<a class="assistive-text" href="#content" title="Skip to primary content">Skip to primary content</a>
</div>
<div class="skip-link">
<a class="assistive-text" href="#secondary" title="Skip to secondary content">Skip to secondary content</a>
</div>
<div class="menu">
<ul>
<li class="page_item page-item-24 current_page_item">
<a href="http://localhost/katarina/?lang=en">Home</a>
</li>
<li class="page_item page-item-26">
<a href="http://localhost/katarina/?page_id=26&lang=en">Contact</a>
</li>
</ul>
</div>
<div id="language-selection">
<ul class="qtrans_language_chooser" id="qtranslate-chooser">
<li class="lang-en active">
<a href="http://localhost/katarina/?lang=en" hreflang="en" title="English" class="qtrans_flag qtrans_flag_en">
<span style="display:none">English</span>
</a>
</li>
<li class="lang-DK">
<a href="http://localhost/katarina/?lang=DK" hreflang="DK" title="Dansk" class="qtrans_flag qtrans_flag_DK">
<span style="display:none">Dansk</span>
</a>
</li>
<li class="lang-fa">
<a href="http://localhost/katarina/?lang=fa" hreflang="fa" title="Farsi" class="qtrans_flag qtrans_flag_fa">
<span style="display:none">Farsi</span>
</a>
</li>
<li class="lang-ar">
<a href="http://localhost/katarina/?lang=ar" hreflang="ar" title="???????" class="qtrans_flag qtrans_flag_ar">
<span style="display:none">???????</span>
</a>
</li>
</ul>
<div class="qtrans_widget_end"></div>
</div>
</nav>
所以基本上我希望悬停和焦点在“Home”和“Contact”链接上保持不变,但要在#language-selection 中的每个 li 元素上停用