2016-07-22 99 views
0

右上角有一个链接,它会显示移动菜单。应该显示在那里的图像不会。手机菜单的问题/图标不显示

#nav-toggle { 
position: absolute; 
top: 0; 
right: 0; 
display: block; 
width: 54px; 
height: 44px; 
overflow: hidden; 
text-indent: -9999px; 
-webkit-user-select: none; 
background: url('http://www.cap-acp.org/_images/icon-res-menu.png') center center no-repeat; } 

    @media screen and (min-width: 767px) { 
.js #nav { 
    position: relative; 
} 
.js #nav.closed { 
    max-height: none; 
} 
#nav-toggle { 
    display: none; 
} 
} 

回答

2

你的形象是一个透明的PNG,只有白条,所以它的存在,但你不能看到它在白色背景。例如,您可以通过为后台CSS声明添加背景色来验证此情况。例如:

+1

谢谢,这个伎俩! – user1110562

0

乔希是对的。如果你改变图像,它应该显示正常。

#nav-toggle { 
    position: absolute; 
    top: 0; 
    right: 0; 
    display: block; 
    width: 54px; 
    height: 44px; 
    overflow: hidden; 
    text-indent: -9999px; 
    -webkit-user-select: none; 

    /* I changed the background src to a different hamburger and it works fine */ 
    background: url('https://www.elavon.com/images/icon-mobile-menu-off.svg') center center no-repeat; 
} 

@media screen and (min-width: 767px) { 
    .js #nav { 
    position: relative; 
    } 
    .js #nav.closed { 
    max-height: none; 
    } 
    #nav-toggle { 
    display: none; 
    } 
}