html - 如何删除 Font Awesome 图标中的下面一行?

标签 html css bootstrap-4 font-awesome

我在导航栏中放置了来自 Font Awesome 的图标购物车。问题是当我用鼠标移动时,这条线出现在购物车图标的左下方。我尝试了很多东西,但找不到删除这一行的方法:

enter image description here

<!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;
}

最佳答案

只需添加此 css 即可更改悬停状态:

.Basket :hover {
  text-decoration: none;
}

关于html - 如何删除 Font Awesome 图标中的下面一行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56383572/

相关文章:

javascript - 从数组填充 Bootstrap 4 表?

javascript - 在滚动条上更改图像 Logo

css - 在 Bootstrap Navbar 中居中品牌标志

java - Selenium,验证字段格式是否正确

html - HTML5 视频的 z-index 分层 (ipad)

html - SVG 绘图动画在 Firefox 中无法正常工作

html - 像 StackExchange 这样的可伸缩标题

html - 如何将li中的div定位到父ul

html - 并行下拉多级菜单

javascript - 使用 jquery onclick 将网页滚动到 div