简体   繁体   中英

Change color of Bootstrap 4 navbar on hover link

I want to know how to change the color when hovering over a link

Thanks for any suggestions?

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>

Maybe you can add some css:

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

Add your own css file to overwrite bootstrap -> nav a:hover{ color: #yourcolor; } nav a:hover{ color: #yourcolor; }

<style>

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM