如何删除“真棒字体”图标下面的行?

时间:2019-05-30 18:15:46

标签: 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;
}

2 个答案:

答案 0 :(得分:0)

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

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

答案 1 :(得分:0)

在悬停时使用:hover选择器消除下划线

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