我可以为每个药丸分配自定义背景颜色,但我真正想要的是每个自定义颜色的褪色(这只是改变上面的值的问题),并且有活性颜色匹配相应药丸的全彩色.
什么时候
我的代码
<ul class="nav nav-pills">
<li class="nav-item pill-1">
<a class="nav-link active" href="#">pill one</a>
</li>
<li class="nav-item pill-2">
<a class="nav-link" href="#">pill two</a>
</li>
<li class="nav-item pill-3">
<a class="nav-link" href="#">pill three</a>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
CSS
.pill-1 a {
background-color: rgba(255, 0, 0, 0.5);
}
Run Code Online (Sandbox Code Playgroud)
引导覆盖
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
color: #fff;
background-color: #d9d9d9;
}
Run Code Online (Sandbox Code Playgroud) 我有一个基于我需要更改href和链接文本的页面的导航,但无法让它工作.
这就是我需要的
<?php
if ($thisPage=="Index-EN" || "Index-IT") {
?>
<li><a href="#" class="scroll-link" data-id="about"><?php echo MENU_ABOUT ?>AAA</a></li>
<li><a href="#" class="scroll-link" data-id="gallery"><?php echo MENU_GALLERY ?></a></li>
<li><a href="<?php echo MENU_CONTACTS_LINK_HOME ?>"><?php echo MENU_CONTACTS ?></a></li>
<?php
} else {
?>
<li><a href="index.php#about" data-id="about"><?php echo MENU_ABOUT ?>BBB</a></li>
<li><a href="index.php#gallery" data-id="gallery"><?php echo MENU_GALLERY ?></a></li>
<li><a href="<?php echo MENU_CONTACTS_LINK ?>"><?php echo MENU_CONTACTS ?></a></li>
<?php
}
?>
Run Code Online (Sandbox Code Playgroud)
这就是我尝试过的,我知道这是错误的,因为导航消失了
<?php
if ($thisPage=="Index-EN" || "Index-IT") {
echo '
<li><a href="#" class="scroll-link" data-id="about">' . MENU_ABOUT . 'AAA</a></li>
<li><a href="#" class="scroll-link" data-id="gallery">' …Run Code Online (Sandbox Code Playgroud)