我有一个响应迅速的网站,运行良好。然而,在桌面版上,我最近将上导航栏中的链接颜色改为白色,但在移动版中,当我点击汉堡菜单时,因为背景也是白色的,所以都是白色的。我看不到链接。如何为移动菜单的链接上色?
不确定需要什么代码,所以我将从这个开始:
<!-- navbar-inverse navbar-fixed-top -->
<nav class="navbar" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<!-- These create the 3 bars for the drop-down menu on mobile screen sizes -->
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-ex1-collapse nav-change">
<ul class="nav navbar-nav navbar-right">
<li><?php if ($thisPage=='analysis') { echo ''; } else { echo '<a href="/analysis/index.php">Analysis</a>'; }?></li>
<li><?php if ($thisPage=='weblog') { echo ''; } else { echo '<a href="/weblog/index.php">Blog</a>'; }?></li>
<li><?php if ($thisPage=='documents') { echo ''; } else { echo '<a href="/documents/index.php">Documents</a>'; }?></li>
<li><?php if ($thisPage=='media') { echo ''; } else { echo '<a href="/media/index.php">Media</a>'; }?></li>
<li><?php if ($thisPage=='books') { echo ''; } else { echo '<a href="/books.php">Books</a>'; }?></li>
<li><?php if ($thisPage=='gaza') { echo ''; } else { echo '<a href="/gaza-commentaries-booklets-pictures.php">Gaza</a>'; }?></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Myths <b class="caret"></b></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li><?php if ($thisPage=='myths') { echo ''; } else { echo '<a href="/palestinian-myths/index.php">'Palestine' & 'Palestinians'</a>'; }?></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Links <b class="caret"></b></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li><?php if ($thisPage=='supportIsrael') { echo ''; } else { echo '<a href="/links2.php">Support Israel Links</a>'; }?></li>
<li><?php if ($thisPage=='interest') { echo ''; } else { echo '<a href="/links.php">Links of Interest</a>'; }?></li>
<li><?php if ($thisPage=='newsMedia') { echo ''; } else { echo '<a href="/news-services.php">News Media Listing</a>'; }?></li>
</ul>
</li>
<li><?php if ($thisPage=='about') { echo ''; } else { echo '<a href="/about.php">About</a>'; }?></li>
<li><?php if ($thisPage=='home') {echo '';} else { echo '<a href="/index.php">Home</a>';}?></li>
<li><?php if ($thisPage=='contact') { echo ''; } else { echo '<a href="/contact.php">Contact</a>'; }?></li>
</li>
如果需要其他代码来修复此问题,请告诉我。
我想明白了。
@media (max-width: 767px) {
.nav > li, .nav > li > a {
color: #230cf2; !important
}}