意外的 UNDERSCORE 出现
An unexpected UNDERSCORE appearing
我正在使用 w3.css 和很棒的字体图标。我创建了两个 link 并为它们使用了 check
和 time
图标。第一个 link(图标)显示并在其旁边划线 _
。但它不在代码中。我试过更改图标,但它仍然存在。我在 Firefox 中检查了它,下划线是 <a></a>
的一部分,而不是图标。你能帮忙解决这个问题吗?
截图如下:
代码如下:
<td>
<a href="ajaxAction.php?aid=<?php echo $r['id']; ?>">
<i class="fa fa-check w3-text-green w3-hover-green"></i>
</a>
<a href="ajaxAction.php?unid=<?php echo $r['id']; ?>">
<i class="fa fa-times w3-text-red w3-hover-red"></i>
</a>
</td>
单独在样式标签中应用悬停然后检查它或在单独的 CSS 文件中包含它并删除   用户 css 而不是
<style>
a:hover {
color: red;
}
</style>
<td>
<a href="ajaxAction.php?aid=<?php echo $r['id']; ?>">
</a>
<a href="ajaxAction.php?unid=<?php echo $r['id']; ?>">
</a>
</td>
a link 默认带下划线,包含图标和空溢出。
添加
text-decoration: none;
到 links 以防止 links 上的默认下划线样式。
编辑:完整示例(无图标):
<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
<body class="w3-container">
<table>
<tr><td>
<a href="ajaxAction.php?aid=<?php echo $r['id']; ?>">
<i class="fa fa-check w3-text-green w3-hover-green"></i>
</a>
<a href="ajaxAction.php?unid=<?php echo $r['id']; ?>">
<i class="fa fa-times w3-text-red w3-hover-red"></i>
</a>
</td>
</tr>
<tr><td>
<a style="text-decoration:none;" href="ajaxAction.php?aid=<?php echo $r['id']; ?>">
<i class="fa fa-check w3-text-green w3-hover-green">_</i>
</a>
<a style="text-decoration:none;" href="ajaxAction.php?unid=<?php echo $r['id']; ?>">
<i class="fa fa-times w3-text-red w3-hover-red">_</i>
</a>
</td>
</tr>
<tr><td>
<a style="text-decoration:none;" href="ajaxAction.php?aid=<?php echo $r['id']; ?>">
<i class="fa fa-check w3-text-green w3-hover-green">_</i>
</a>
<a style="text-decoration:none;" href="ajaxAction.php?unid=<?php echo $r['id']; ?>">
<i class="fa fa-times w3-text-red w3-hover-red">_</i>
</a>
</td>
</tr>
</table>
</body>
</html>
我正在使用 w3.css 和很棒的字体图标。我创建了两个 link 并为它们使用了 check
和 time
图标。第一个 link(图标)显示并在其旁边划线 _
。但它不在代码中。我试过更改图标,但它仍然存在。我在 Firefox 中检查了它,下划线是 <a></a>
的一部分,而不是图标。你能帮忙解决这个问题吗?
截图如下:
代码如下:
<td>
<a href="ajaxAction.php?aid=<?php echo $r['id']; ?>">
<i class="fa fa-check w3-text-green w3-hover-green"></i>
</a>
<a href="ajaxAction.php?unid=<?php echo $r['id']; ?>">
<i class="fa fa-times w3-text-red w3-hover-red"></i>
</a>
</td>
单独在样式标签中应用悬停然后检查它或在单独的 CSS 文件中包含它并删除   用户 css 而不是
<style>
a:hover {
color: red;
}
</style>
<td>
<a href="ajaxAction.php?aid=<?php echo $r['id']; ?>">
</a>
<a href="ajaxAction.php?unid=<?php echo $r['id']; ?>">
</a>
</td>
a link 默认带下划线,包含图标和空溢出。
添加
text-decoration: none;
到 links 以防止 links 上的默认下划线样式。
编辑:完整示例(无图标):
<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
<body class="w3-container">
<table>
<tr><td>
<a href="ajaxAction.php?aid=<?php echo $r['id']; ?>">
<i class="fa fa-check w3-text-green w3-hover-green"></i>
</a>
<a href="ajaxAction.php?unid=<?php echo $r['id']; ?>">
<i class="fa fa-times w3-text-red w3-hover-red"></i>
</a>
</td>
</tr>
<tr><td>
<a style="text-decoration:none;" href="ajaxAction.php?aid=<?php echo $r['id']; ?>">
<i class="fa fa-check w3-text-green w3-hover-green">_</i>
</a>
<a style="text-decoration:none;" href="ajaxAction.php?unid=<?php echo $r['id']; ?>">
<i class="fa fa-times w3-text-red w3-hover-red">_</i>
</a>
</td>
</tr>
<tr><td>
<a style="text-decoration:none;" href="ajaxAction.php?aid=<?php echo $r['id']; ?>">
<i class="fa fa-check w3-text-green w3-hover-green">_</i>
</a>
<a style="text-decoration:none;" href="ajaxAction.php?unid=<?php echo $r['id']; ?>">
<i class="fa fa-times w3-text-red w3-hover-red">_</i>
</a>
</td>
</tr>
</table>
</body>
</html>