我很难弄清楚为什么移动菜单图标不会显示在以下网站上:
你会看到你调整到较小的尺寸,在右上角有一个链接,它会调出移动菜单。应该显示的图像不是。
#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;
}
}
答案 0 :(得分:2)
您的图片是透明的.png,只有白色条纹,所以它在那里,但您无法在白色背景下看到它。您可以通过向背景CSS声明添加背景颜色来验证这一点,例如:
background: red url('http://www.cap-acp.org/_images/icon-res-menu.png') center center no-repeat
答案 1 :(得分: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;
}
}