-5

How to remove the underline from the link? That's my code I try type some code in there, but still not working

@charset "utf-8";
/* CSS Document */
.top {
  color:black;
  font-family:Calibri;
  text-decoration:none;
}

table {

}
<table>
  <tr>
    <td><a href="Home.html"><p class="top">Home</p></a></td>
  </tr>
</table>
Nhan
  • 3,595
  • 6
  • 30
  • 38
Max.W
  • 31
  • 1
  • 1
  • 2

5 Answers5

2

Your .top class changes the style for the p tag, however it is the a tag that sets the text-decoration, so you will have to specify that or add to your a tag another class and set it's text-decoration attribute.

A possible way:

<table>
  <tr>
    <td>
      <a href="Home.html" class="no-underline">
        <p class="top">Home</p>
      </a>
    </td>
  </tr>
</table>

and

.no-underline {
  text-decoration: none;
}
Neikos
  • 1,840
  • 1
  • 22
  • 35
1

You have to set text-decoration: none to the <a> tag itself, not to the <p> which is inside of it.

Chris Bier
  • 14,183
  • 17
  • 67
  • 103
Marcin Dusza
  • 412
  • 3
  • 10
1

Should be this:

a {
  text-decoration: none;
}
Nhan
  • 3,595
  • 6
  • 30
  • 38
1

You are looking for text-decoration:none

try,

a {
    text-decoration:none;
}
Bhavesh G
  • 3,000
  • 4
  • 39
  • 66
0

I replaced .top by the a tag

@charset "utf-8";
/* CSS Document */
a {
    color:black;
    font-family:Calibri;
    text-decoration:none;
}

table {

}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Home</title>
<link rel="stylesheet" type="text/css" href="css.css">`enter code here`

</head>

<body>
<table>
    <tr>
        <td><a href="Home.html"><p class="top">Home</p></a></td>
    </tr>
</table>
</body>
</html>
Weedoze
  • 13,683
  • 1
  • 33
  • 63