以下是我用来显示菜单的代码。您可能会看到,菜单项是图像而不是文本。当我点击切换按钮时,我想要做的是恢复显示文本链接而不是移动和小屏幕设备的图像。我不知道了吗??
<nav class="navbar navbar-default header-sketch">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html#top"><img class="logo" alt="CarShare Logo" src="img/car-logo.png"></a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right desktop">
<li><a class="toscroll" href="#top" title="Home"><img alt="Home" src="img/home.png"></a></li>
<li><a class="toscroll" href="#about" title="About CarShare"><img alt="About CarShare" src="img/about.png"></a></li>
<li><a class="toscroll" href="#signup" title="Sign Up"><img alt="Sign Up" src="img/signup.png"></a></li>
</ul>
</div><!-- End Navbar Collapse -->
</div><!-- End Container Fluid -->
</nav><!-- End Nav -->
答案 0 :(得分:2)
将类hidden-xs
添加到图像和&#39; visible-xs&#39;到文本。
您可以在此处阅读有关responsive utilities of bootstrap的更多信息
例如。
<a href="#">
<span class="visible-xs">Home</span>
<img class="hidden-xs" alt="Home" src="img/home.png">
</a>