活动链接悬停区域更改/错误?

时间:2014-07-03 21:57:46

标签: css menu hover shopify liquid

我的网站是www.teamanco.com我在嵌套菜单上悬停时出现问题。如果你进入第二级,那很好,但是第三级菜单有一个混乱的选择/悬停。救命?我不知道从哪里开始。我建立在shopify上。

}
.main-nav {
  float: left;
  padding: 0;
  margin: 0;
  list-style: none;
  width: 100%;
}
.main-nav > li:hover > ul {
  -webkit-opacity: 1;
  -moz-opacity: 1;
  opacity: 1;
  height: auto;
  overflow: visible;
}
.main-nav > li:hover > ul > li:hover > a {
  color: {{ settings.main_nav_link_hover }};
  background-color: #eaeaea;
}
.main-nav > li:hover > ul > li:hover > ul {
  -webkit-opacity: 1;
  -moz-opacity: 1;
  opacity: 1;
  height: auto;
  overflow: visible;
}
.main-nav > li:hover > ul > li:hover > ul > li:hover > a {
  color: {{ settings.main_nav_link_hover }};
  background-color: #eaeaea;
}
.main-nav > li:hover > ul > li:hover > ul > li:hover > ul {
  -webkit-opacity: 1;
  -moz-opacity: 1;
  opacity: 1;
  height: auto;
  overflow: visible;
}
.main-nav > li:hover > ul > li:hover > ul > li:hover > ul > li:hover > a {
  color: {{ settings.main_nav_link_hover }};
  background-color: #eaeaea;
}
.main-nav > li:hover > ul > li:hover > ul > li:hover > ul > li:hover > ul {
  -webkit-opacity: 1;
  -moz-opacity: 1;
  opacity: 1;
  height: auto;
  overflow: visible;
}
.main-nav > li:hover > ul > li:hover > ul > li:hover > ul > li:hover > ul > li:hover > a {
  color: {{ settings.main_nav_link_hover }};
  background-color: #eaeaea;
}
.main-nav > li:hover > ul > li:hover > ul > li:hover > ul > li:hover > ul > li:hover > ul {
  -webkit-opacity: 1;
  -moz-opacity: 1;
  opacity: 1;
  height: auto;
  overflow: visible;
}
.main-nav > li {
  float: left;
  margin-left: 60px;
  border-top: solid 2px transparent;
  margin-top: -2px;
  -webkit-transition: all 0.4s ease-in-out;
  -moz-transition: all 0.4s ease-in-out;
  -o-transition: all 0.4s ease-in-out;
  -ms-transition: all 0.4s ease-in-out;
  transition: all 0.4s ease-in-out;
  position: relative;
}
.main-nav > li:first-child {
  margin-left: 0px;
}
.main-nav > li.active {
  border-top: solid 2px {{ settings.main_nav_link }};
}
.main-nav > li.active > a {
  color: {{ settings.main_nav_link_hover }};
}
.main-nav > li:hover {
  border-top: solid 2px {{ settings.main_nav_link }};
}
.main-nav > li:hover > a {
  color: {{ settings.main_nav_link_hover }};
}
.main-nav > li > a {
  font-family: "{{ settings.secondary_font }}", Arial, sans-serif;
  font-size: 16px;
  padding:12px 0px 11px;
  float:left;
  color: {{ settings.main_nav_link }};
  text-decoration: none;
  -webkit-transition: all 0.4s ease-in-out;
  -moz-transition: all 0.4s ease-in-out;
  -o-transition: all 0.4s ease-in-out;
  -ms-transition: all 0.4s ease-in-out;
  transition: all 0.4s ease-in-out;
}
.main-nav > li > a.has-dropdown {
  position: relative;
}
.main-nav > li > a.has-dropdown:after {
  content: "";
  position: absolute;
  border-right: 4px solid transparent;
  border-top: 4px solid {{ settings.main_nav_link }};
  border-left: 4px solid transparent;
  border-top-color: {{ settings.main_nav_link }};
  top: 7px;
  right: -14px;
}
.main-nav > li > ul {
  position: absolute;
  top: 100%;
  left: 0px;
  width: 150px;
  background-color: #f2f2f2;
  padding: 10px 0;
  -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
  -moz-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
  list-style: none;
  margin: 0;
  z-index: 201;
  -webkit-border-radius: 0 0 4px 4px;
  -webkit-background-clip: padding-box;
  -moz-border-radius: 0 0 4px 4px;
  -moz-background-clip: padding;
  border-radius: 0 0 4px 4px;
  background-clip: padding-box;
  height: 0;
  -webkit-opacity: 0;
  -moz-opacity: 0;
  opacity: 0;
  overflow: hidden;
  -webkit-transition: opacity 0.4s ease-in-out;
  -moz-transition: opacity 0.4s ease-in-out;
  -o-transition: opacity 0.4s ease-in-out;
  -ms-transition: opacity 0.4s ease-in-out;
  transition: opacity 0.4s ease-in-out;
}
.main-nav > li > ul > li {
  float: left;
  width: 100%;
  position: relative;
}
.main-nav > li > ul > li:hover > a {
  color: {{ settings.main_nav_link_hover }};
  background-color: #eaeaea;
}
.main-nav > li > ul > li > a {
  float: left;
  width: 100%;
  padding: 10px 15px;
  font-family: "{{ settings.secondary_font }}", Arial, sans-serif;
  font-size: 14px;
  color: {{ settings.main_nav_link }};
  text-decoration: none;
  -webkit-transition: all 0.4s ease-in-out;
  -moz-transition: all 0.4s ease-in-out;
  -o-transition: all 0.4s ease-in-out;
  -ms-transition: all 0.4s ease-in-out;
  transition: all 0.4s ease-in-out;
}
.main-nav > li > ul > li ul {
  position: absolute;
  top: 0px;
  left: 100%;
  width: 150px;
  background-color: #f2f2f2;
  padding: 10px 0;
  -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
  -moz-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
  list-style: none;
  margin: 0;
  z-index: 200;
  -webkit-border-radius: 0 0 4px 4px;
  -webkit-background-clip: padding-box;
  -moz-border-radius: 0 0 4px 4px;
  -moz-background-clip: padding;
  border-radius: 0 0 4px 4px;
  background-clip: padding-box;
  height: 0;
  -webkit-opacity: 0;
  -moz-opacity: 0;
  opacity: 0;
  overflow: hidden;
  -webkit-transition: opacity 0.4s ease-in-out;
  -moz-transition: opacity 0.4s ease-in-out;
  -o-transition: opacity 0.4s ease-in-out;
  -ms-transition: opacity 0.4s ease-in-out;
  transition: opacity 0.4s ease-in-out;
}
.main-nav > li > ul > li ul li {
  float: left;
  width: 100%;
  position: relative;
}
.main-nav > li > ul > li ul li a {
  float: left;
  width: 100%;
  padding: 10px 15px;
  font-family: "{{ settings.secondary_font }}", Arial, sans-serif;
  font-size: 14px;
  color: {{ settings.main_nav_link }};
  text-decoration: none;
  -webkit-transition: all 0.4s ease-in-out;
  -moz-transition: all 0.4s ease-in-out;
  -o-transition: all 0.4s ease-in-out;
  -ms-transition: all 0.4s ease-in-out;
  transition: all 0.4s ease-in-out;
}

1 个答案:

答案 0 :(得分:0)

如果您在顶部导航级别上左右移动鼠标,则当您将鼠标悬停在第二级时,您会看到相同的问题。移动鼠标后,一个瘦小的灰色框似乎暂时挂起,列表已消失。它是由<ul>标记上的填充引起的。删除这些行,看看是否能解决问题:

.main-nav > li > ul {
  ...
  padding: 10px 0;
  ...
}

.main-nav > li > ul > li ul {
  ...
  padding: 10px 0;
  ...
}

当你移开鼠标时,似乎列表项(<li>)会立即消失,但<ul>(现在只包含填充)的不透明度随着转换而消失。