html - 移动菜单问题/图标不显示

标签 html css responsive-design

我很难弄清楚为什么移动菜单图标不会显示在以下网站上:

您会看到,如果您将尺寸缩小到更小的尺寸,那么在右上角有一个确实会调出移动菜单的链接。但是应该在那里显示的图像却没有。

#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;
 }
}

最佳答案

您的图像是透明的 .png,只有白色条,所以它就在那里,但您无法在白色背景下看到它。您可以通过向背景 CSS 声明添加背景颜色来验证这一点,例如:

background: red url('http://www.cap-acp.org/_images/icon-res-menu.png') center center no-repeat

关于html - 移动菜单问题/图标不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38528709/

相关文章:

html - windows浏览器如何自动隐藏滚动条

javascript - getElementbyID 用于加载音乐播放器数据

javascript - HTML 文本区域永久边框颜色

javascript - 从 JSON 获取缩略图

html - Bootstrap Navbar 非折叠(防止)

css - Twitter bootstrap 3 - 比较每个设备上的列比率

javascript - 将 topLeft、topRight、bottomLeft 和 bottomRight id 的内容居中

css - 如何在 Web 应用程序中使用 SVG Logo ?

android - 在 WebView 中从 url 加载图像(垂直居中)

html - 在 Internet Explorer 中将文本输入垂直居中