html - Wordpress CSS 无法正确显示导航

标签 html css wordpress

我在 wordpress 上创建了一个网站,第二层菜单(如果您单击“服装”或“包”则显示)从父页面下方开始

无论点击'服装'还是'包包',我都希望与一级菜单保持一致

http://www.dawaf.co.uk/showroom/bags

/*Main Navigation
------------------------------------------------------------ */
#access {
    background: none;
    -webkit-box-shadow: none;
    text-align:center;
    box-shadow: none;
    margin: -10px auto 6px;
    text-transform: uppercase;
    font-weight: bold;
}

#access div {
    margin: 0 0.5%;
}

#access a {
    color: #EEEEEE;
    line-height: 2.2;
    padding: 0 8px;
    font-size: 12px;
}



#access ul ul {
    width: 800px;
}

#access ul ul a {
    width: auto;
    background: transparent !important;
    font-weight: bold;
    font-size: 12px;
}

#access ul ul li:hover a {
    color: #666666;
}

#access li.current_page_item  ul {
    display: block;
}

#access li:hover > a {
    background: transparent !important;
    color: #666;
}

#access ul li:hover > ul {
display: none;
}

#access ul li.current_page_item:hover > ul {
display: block;
}

/*Submenu
------------------------------------------------------------ */

#access ul ul {
    -webkit-box-shadow: none;
    box-shadow: none;
}

#access ul ul a {
    background: #000;
    border-bottom: none;
    color: #EEEEEE;
    line-height: 0.4;
}

#access li:hover > a, #access ul ul :hover > a, #access a:focus {
    background: #FFF;
}

ul.children {
    width: 1000px !important;
    background: transparent !important;
    margin-top: -15px !important;
    border-top: 1px solid #EEEEEE;
}

最佳答案

您是否希望它们像在顶部菜单项的右侧一样内嵌? 即:

服装-包袋> 日 |晚上

或者您是否希望它们在页面左侧同一位置的顶部菜单行下排列? 即:

服装 - 手袋 天 |晚上

服装 - 手袋 连衣裙 |连衣裤

无论哪种方式,您都希望使用“#access ul ul”css 属性。您的二级菜单是嵌套在主级菜单的 ul 中的 ul。如果您无法按原样获得所需的控件,您可能希望将二级菜单拆分到它自己的未嵌套的 ul 中。

关于html - Wordpress CSS 无法正确显示导航,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9608372/

相关文章:

html - 这个图灵完备规则 110 在 HTML5+CSS3 中的实现是如何工作的?

php - 通过 id 获取 div 值 - Javascript

javascript - [vue] : how to add dynamic class using css modules along with normal class css on the same element in Vue?

css - 多个标签来切换复选框

php - MySQL/PHPMyAdmin

javascript - 添加指向外部网站的链接及其 HTML 中的概要

html - Github 页面未在子文件夹上加载 css

javascript - 如何在 HTML 5 全屏模式下禁用默认关闭选项

php - 我的自定义帖子类型 URL Slug 中缺少连字符

php - 创建重定向到另一个 URL 的 WordPress 页面