导航菜单可点击区域延伸超过导航按钮

时间:2013-01-08 21:40:01

标签: css wordpress wordpress-thesis-theme

出于某种原因,位于www.hungryrunnergirl.com左侧边栏顶部的社交媒体图标会阻止点击以下的存档小部件。当我将每个按钮位置设置为绝对位置(容器保持相对)时,我没有这个问题,但是当我这样做时,按钮显示在不同的位置,具体取决于您查看的浏览器。有没有人能够深入了解为什么会发生这种情况(使用相对CSS定位时使用绝对区域或不可点击区域时的位置不一致)?

以下是我目前用来设置菜单样式的代码:

/* Menu Container */
.custom .sidebar .menu {
  list-style: none;
  padding: 0;
  margin: 0 0 0 10px;
  width: 190px;
  height: 190px;
  position: relative;
}
/* Facebook */
.custom #menu-item-15470 a {
    display:block;
height:81px;
width:80px;
padding:0px;
margin-left:0px;
position: relative;
left: 0px;
top: 0px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:-83px 0px;
}
.custom #menu-item-15470 a:hover { 
    background-position:0px 0; 
}
/* Pinterest */
.custom #menu-item-15471 a {
display:block;
height:81px;
width:80px;
padding:0px;
margin-left:10px;
position: relative;
left: 81px;
top: -81px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:-83px -82px;
}
.custom #menu-item-15471 a:hover { 
    background-position:0px -82px; 
}
/* Instagram */
.custom #menu-item-15472 a {
display:block;
height:81px;
width:80px;
padding:0px;
margin-top:10px;
position: relative;
left: 0px;
top: -81px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:-83px -165px;
}
.custom #menu-item-15472 a:hover { 
background-position:0px -165px; 
}
/* Twitter */
.custom #menu-item-15475 a {
display:block;
height:81px;
width:80px;
padding:0px;
margin-left:10px;
margin-top:10px;
position: relative;
left: 81px;
top: -172px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:-83px -248px;
}
.custom #menu-item-15475 a:hover { 
background-position:0px -248px; 
}

非常感谢你的帮助。

1 个答案:

答案 0 :(得分:1)

将以下内容添加到li.widget(第191行):

position: relative;
z-index: 100;