导航图标未显示在移动版本上?

Navigation icon not showing up on mobile version?

所以我修改了 css 元素以添加 background image but so far nothing succeeded in displaying the navigation icon on mobile devices. Please assist me in debuging the code in responsive design view at Link 并告诉我什么有效。感谢您在下方time.regular css

#menu-icon {
    display: none;
    background-image: url(http://www.w3newbie.com/wp-content/uploads/icon.png) center;
    width: 40px;
    height: 40px;
    background-image: no-repeat;
}

手机css下方

#menu-icon{
    display: block;
}

background-image 没有位置 center 那样的多重属性。应该是background。同样对于重复语法应该是 background-repeat。像下面这样更新您的 CSS。

  #menu-icon {
    display: none;
    background: url(http://www.w3newbie.com/wp-content/uploads/icon.png) center;
    width: 40px;
    height: 40px;
    background-repeat: no-repeat;
  }

或者您可以像下面这样使用它。

  #menu-icon {
    display: none;
    background-image: url(http://www.w3newbie.com/wp-content/uploads/icon.png);
    background-position:center;
    width: 40px;
    height: 40px;
    background-repeat: no-repeat;
  }

您的手机没有问题 CSS。