更改悬停链接上Bootstrap 4导航栏的颜色



我想知道当鼠标悬停在链接上时如何更改颜色

谢谢你的建议?

HTML:

<nav>
<a class="underline" href="welcome.html">./home </a>
<a class="underline" href="about.html">./about </a>
<a class="underline" href="projects.html">./projects </a>
<a class="underline" href="ctf.html">./ctf's</a>
</nav>

我确实通过解决了这个问题

a[href] {
color: #ffff; /* Change this to which color you prefer */
}

在css 中

也许你可以添加一些css:

<style>
.underline:hover {
color: red; /* text color */
background-color: blue;
}
</style>

添加您自己的css文件以覆盖引导程序->nav a :hover{ color: #yourcolor; }

<style>
.underline:hover {
color: red !important;  /* for link text color */
text-decoration: none; /* for delete under line */
}
</style>

最新更新