Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot change hover color for link inside a div

Tags:

css

I try to add a custom color to a link inside a div but its not working, the color does not change. Why is that?

<!DOCTYPE HTML>

<html>

<head>
  <title>Untitled</title>
  <style>
      .navigation-div a {
        display: block;
        font-size: 18px;
        color: #14133b !important;
        line-height: 1;
        margin-bottom: 26px;
    }

    .navigation-div a:hover {
        color: #CEA941 !important;
    }

    .navigation-div a:visited {
        color: #14133b !important;
    }
    .navigation-div a:link {
        color: #14133b !important;
    }
    .navigation-div a:visited {
        color: #14133b !important;
    }
  </style>
</head>

<body>
<table class="table" style="border-bottom: 0px solid black;">
<tbody><tr>
<td valign="top"></td>
<td valign="top">header 1</td>
<td valign="top">header 2</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td valign="top"></td>
<td><div class="navigation-div">
<a href="#"> Motor  </a></div>
</td>
<td><div class="navigation-div">
<a href="#">12345 </a></div>
</td>
</tr>

</tbody></table>
</body>

</html>
like image 936
MTplus Avatar asked Feb 07 '26 07:02

MTplus


1 Answers

<!DOCTYPE HTML>

<html>

<head>
  <title>Untitled</title>
  <style>
      .navigation-div a {
        display: block;
        font-size: 18px;
        color: #14133b !important;
        line-height: 1;
        margin-bottom: 26px;
    }

    td .navigation-div a:hover {
        color: #CEA941 !important;
    }

    .navigation-div a:visited {
        color: #14133b !important;
    }
    .navigation-div a:link {
        color: #14133b !important;
    }
    .navigation-div a:visited {
        color: #14133b !important;
    }
  </style>
</head>

<body>
<table class="table" style="border-bottom: 0px solid black;">
<tbody><tr>
<td valign="top"></td>
<td valign="top">header 1</td>
<td valign="top">header 2</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td valign="top"></td>
<td><div class="navigation-div">
<a href="#"> Motor  </a></div>
</td>
<td><div class="navigation-div">
<a href="#">12345 </a></div>
</td>
</tr>

</tbody></table>
</body>

</html>

use this code . it's work .

like image 98
Smit Avatar answered Feb 09 '26 08:02

Smit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!