Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
css文件中Wordpress菜单结构的更改_Wordpress_Drop Down Menu - Fatal编程技术网

css文件中Wordpress菜单结构的更改

css文件中Wordpress菜单结构的更改,wordpress,drop-down-menu,Wordpress,Drop Down Menu,我在我的网站上使用了wordpress twenty-eleven主题。现在我想为我的网站创建一个下拉菜单。默认情况下,wordpress具有下拉菜单功能。现在,当我在主菜单上悬停时,我得到了子菜单部分。例如:- 我有一个主菜单,如:- 主页|关于|联系人 Our Services History Our Staff Our Services History History 1 History 2 History 3

我在我的网站上使用了wordpress twenty-eleven主题。现在我想为我的网站创建一个下拉菜单。默认情况下,wordpress具有下拉菜单功能。现在,当我在主菜单上悬停时,我得到了子菜单部分。例如:-

我有一个主菜单,如:- 主页|关于|联系人

   Our Services

   History

   Our Staff
   Our Services

   History

      History 1
      History 2
      History 3

   Our Staff
   Our Services

   History

      History 1
      History 2
      History 3

   Our Staff
当我停留在“关于”菜单上时,它会显示“关于”菜单的子菜单,如

主页|关于|联系人

   Our Services

   History

   Our Staff
   Our Services

   History

      History 1
      History 2
      History 3

   Our Staff
   Our Services

   History

      History 1
      History 2
      History 3

   Our Staff
当我将鼠标悬停在历史菜单上时,它会显示历史菜单的子菜单,如下图所示:-

主页|关于|联系人

   Our Services

   History

   Our Staff
   Our Services

   History

      History 1
      History 2
      History 3

   Our Staff
   Our Services

   History

      History 1
      History 2
      History 3

   Our Staff
但当我将鼠标悬停在“关于”菜单上时,我想显示历史的子菜单。如果我将鼠标悬停在“关于”菜单上,它将显示如下:-

主页|关于|联系人

   Our Services

   History

   Our Staff
   Our Services

   History

      History 1
      History 2
      History 3

   Our Staff
   Our Services

   History

      History 1
      History 2
      History 3

   Our Staff
请帮我在wordpress菜单中获取输出

#access {
  background: #00ADEE; /* Show a solid color for older browsers */
  clear: both;
  display: block;
  width: 915px;
}
#access ul {
  font-size: 11px;
  list-style: none;
  margin: 0;
  padding: 0;
}
#access li {
  float: left;
  position: relative;
}
#access a {
  color: #eee;
  display: block;
  line-height: 12px;
  padding: 4px 9px; 
  text-decoration: none;
  background: url(images/menu-border.png);
  background-position: right 6px;
  background-repeat: no-repeat;
  text-transform: lowercase;
}
#access ul ul {
  display: none;
  float: left;
  margin: 0;
  position: absolute;
  left: 11px;
  width: 252px;
  z-index: 99999;
  background: #FFFFFF;
  padding: 0 4px;
  border: 1px solid #00AEEF;
}
#access ul ul li {
}
#access ul ul ul {
  left: 23%;
  top: 0;
  border: none;
  width: 150px;
}
#access ul ul ul li{
  border: none;
  width: 112px;
  background:url(images/list.png);
  background-position: 0 10px;
  background-repeat: no-repeat;
  background-color: #FFF;
  width: 185px;
}
#access ul ul ul a{
  border: none;
  background: transparent;
}
.sub-menu .menu-item-object-custom a:hover{
  height: 40px;
}
#access ul ul a {
  border-bottom: 1px solid #BCBEC0;
  color: #000;
  font-size: 10px;
  font-weight: normal;
  height: auto;
  line-height: 1.4em;
  padding: 5px 7px;
  width: 237px;
}
#access li:hover > a,
#access ul ul :hover > a,
#access a:focus {
  color: #000;
}

#access ul ul  > a {
  color: #000;
}

#access li:hover > a,
#access a:focus {
  color: #FFFFFF;
}
#access ul li:hover > ul {
  display: block;
}
#access ul ul  .current_page_item > a {
  color: #00ADEE;
  font-weight: bold;
}
#access .current-menu-item > a,
#access .current-menu-ancestor > a,
#access .current_page_item > a,
#access .current_page_ancestor > a {
  color: #FFFFFF;
}

基本上,您需要找到在li元素上定义了:hover的规则。通常是这样的:

li:hover ul {
    display: block;
}
要使第二级菜单可见,您需要添加以下内容:

li:hover ul ul {
    display: block;
}

理论上应该是这样的,我需要看到CSS中描述菜单的部分,这样我就可以告诉您要做的确切更改。

再详细阐述一下您的说明。这太让人困惑了,这只不过是wordpress twenty-eleven主题中的下拉菜单和上面的下拉菜单。第一个黑暗区域是第一个下拉菜单,主菜单部分是所有黑暗区域的上方。“家|关于|联系”。第二个暗区是默认输出,第三个暗区是我想要的输出。我想第三个黑暗区域类型下拉菜单应该显示,当我停留在“关于”菜单上。我没有看到第二个和第三个黑暗区域之间的任何区别。嘿,库萨尔,我已经描述过,第二种状态是我在“历史”子菜单上悬停时的状态,第三种状态是我在“关于”菜单上悬停时的状态。这是我想要的,所以第二个和第三个是相同的,但是当你在子菜单历史上悬停时,它会像第二个区域一样显示,但是我想当我在“关于”菜单上悬停时,它会像第二个一样显示。第二个和第三个完全一样,不客气。如果你的问题的答案有帮助,接受它。如果你自己解决了问题,写下来并接受它作为答案,这样搜索同一问题的人就会知道问题是如何解决的。谢谢拉扎尔·武科维奇。我不得不把菜单显示为我提到的第三个黑暗区域。现在我只是在二十个elecen的css文件中添加了一行代码。像这样的咆哮。如果是错误的,那么建议我。#访问ul-li:hover>ul-li-ul,#访问ul-li:hover>ul{display:block;}是的,这就是我在回答中描述的原则。请接受。