Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Need to give a color to a menu link in html css

Please find the code for navbar below. How can I give the color to the html link like Home,Services and About

   <!--navbar-->
   <!--navbar-->
   <nav class="navbar navbar-expand-lg navbar-light bg-light">
   <div class="container-fluid">
    
    <div class="navimg">
    
      <img src="./img/Heliosupdated.png" alt="Description">

    </div>
    
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-                 target="#navbarNav"
      aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
     /button>
     <div class="collapse navbar-collapse" id="navbarNav">
      <ul class="navbar-nav">
        <li class="nav-item">
          <a class="nav-link active" aria-current="page" href="#">Home</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#">Services</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#">About</a>
        </li>

     </ul>
    </div>`
    </div>
    </nav>`

`
I am expecting the color to be changed once the external CSS is being applied.

I tried to give this external css as mentioned below,

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

`.nav-link active a {

color:#2762AC;

}`

>Solution :

use !important in your external css file

.nav-link active a {

color:#2762AC !important;

}`

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading