html - 如何在 Font Awesome 图标中删除下面的行?
问题描述
我在导航栏中放置了一个来自 Font Awesome 的图标购物车。问题是当我用鼠标移动时,这条线出现在购物车图标的左下方。我尝试了很多东西,但找不到删除此行的方法:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="main.css">
<title>Σκοτεινή Πλευρά</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
</head>
<body>
<nav>
<div class="row justify-content-center">
<div class="Basket">
<a href="#">
<i class="fa fa-shopping-cart" aria-hidden="true"></i>
<span class="Basket_Number">2</span>
</a>
</div>
</div>
</nav>
</body>
</html>
.Basket {
display: inline-block;
text-align: center;
margin-right: 11px;
margin-bottom: -6px;
}
.Basket a {
display: flex;
flex-direction: column;
justify-content: center;
position: relative;
margin-top: 100px;
font-size: 30px;
width: 40px;
height: 40px;
color: #332f25;
transition: color 0.3s ease;
text-decoration: none;
}
.Basket_Number {
display: flex;
flex-direction: column;
justify-content: center;
position: absolute;
top: -15px;
left: 35px;
width: 20px;
height: 20px;
border-radius: 50%;
background: #fe4c50;
font-size: 12px;
color: white;
}
解决方案
悬停时使用 :hover 选择器去掉下划线
.Basket a:hover {
text-decoration: none;
}
推荐阅读
- wordpress - Wordpress 古腾堡块
- spatialite - EF Core 空间数据距离
- c# - AWSSDK 未生成新的 PreSigned URL(始终过期)
- angular - 我应该手动安装所有对等依赖项以删除 npm 警告吗?
- forms - 如何在 PERL-CGI 中读取多个复选框
- html - 当列的宽度不适合其容器时,如何垂直包装列?
- python - 如何使用 Python 从多个分类分布中采样
- javascript - 使用 thymeleaf 访问 JS 文件中的图像
- java - 正则表达式在java中的给定字符串语句中用星*屏蔽密码
- python - 如何有效地将函数应用于图像中每个像素的每个通道(用于颜色转换)?