老师检查一下,导航小图标不显示

来源:5-2 项目作业

DB1时间的玫瑰

2021-07-20 09:41:15

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>慕家居</title>

    <meta name="description" content="慕家居,触手可及的家居风格!!">

    <meta name="keywords" content="慕家居,简洁,自然,人性化,北欧简约风!!!">

    <style>  

    ​    ​      ​body {

    ​    ​    ​    ​    font-familyHelvetica;;

    ​    ​    ​    ​}

    ​    ​    ​    ​.center-wrap {

    ​    ​    ​    ​    width1200px;

    ​    ​    ​    ​    margin0 auto;

    ​    ​    ​    ​}

    ​    ​    ​    ​.clearfix {

    ​    ​    ​    ​    overflowhidden;

    ​    ​    ​    ​}

    ​    ​    ​    ​

/* top区域 */

.top {

    height40px;

    background-color#0058AA;

}

.top .topbar {

    min-width1200px;

    height40px;

    line-height40px;

    colorwhite;

    font-size18px;

}

.top .topbar p {

    floatright;

}

/* header区域 */

.header {

    height121px;

    /* 子绝父相 */

    positionrelative;

}

/* logo */

.header .logo {

    floatleft;

    width192px;

    height91px;

    font-size64px;

    color#0058AA;

    line-height91px;

}

.header .logo h1 {

    floatleft;

    width192px;

    height91px;

    backgroundurl(../images/慕家居.png);

    background-sizecover;

    /* 将段首缩进这个属性设置为负数,可以用这个方法隐藏文字 */

    text-indent-999em;

    /* 设置触碰时候的鼠标的样式 */

    cursorpointer;

}

/* 导航 */

.header nav {

    width736px;

    height91px;

    padding-left290px;

}

.header nav ul {

    floatleft;

}

.header nav ul li {

    floatleft;

    padding-right61px;

}

.header nav ul li:last-child {

    padding-right0;

}

.header nav ul li a span:first-child {

    width33px;

    height33px;

    margin10px auto;

    padding8px;

    /* 设置圆角 */

    border-radius50%;

}

.header nav ul li a span:first-child:hover{

    background#0058AA;

    animation: r .3s ease infinite;

}

/* 动画效果 */

@keyframes r {

    0% {

        transformscale(1.0);

    }

    50% {

        transformscale(1.05);

    }

    100% {

        transformscale(1.0);

    }

}

.header nav ul li span.home-gry {

    backgroundurl(../images/home-gry.pngcenter center no-repeat;

}

.header nav ul li span.home-gry:hover {

    backgroundurl(../images/home-white.pngcenter center no-repeat;

}

.header nav ul li span.abouts-gry {

    backgroundurl(../images/abouts-gry.pngcenter center no-repeat;

}

.header nav ul li span.abouts-gry:hover {

    backgroundurl(../images/abouts-white.pngcenter center no-repeat;

}

.header nav ul li span.kefu-gry {

    backgroundurl(../images/kefu-gry.pngcenter center no-repeat;

}

.header nav ul li span.kefu-gry:hover {

    backgroundurl(../images/kefu-white.pngcenter center no-repeat;

}

.header nav ul li span.chanpin-gry {

    backgroundurl(../images/chanpin-gry.pngcenter center no-repeat;

}

.header nav ul li span.chanpin-gry:hover {

    backgroundurl(../images/chanpin-white.pngcenter center no-repeat;

}

.header nav ul li span.fuwu-gry {

    backgroundurl(../images/fuwu-gry.pngcenter center no-repeat;

}

.header nav ul li span.fuwu-gry:hover {

    backgroundurl(../images/fuwu-white.pngcenter center no-repeat;

}

.header nav ul li span {

    displayblock;

    text-aligncenter;

    font-size16px;

    color#545454;

}

    ​  </style>

</head>

<body>

    <!-- top区域 -->

   <section class="top">

        <div class="topbar">

            <div class="center-wrap">

                <p>服务热线:400-8888-888</p>

            </div>

        </div>

   </section>


   <!-- header区域 -->

   <section class="header center-wrap clearfix">

       <!-- logo -->

        <div class="logo">

            <h1>慕家居</h1>

        </div>


        <!-- 导航栏 -->

        <nav>

            <ul>

                <li>

                    <a href="">

                        <span class="home-gry"></span>

                        <span>网站首页</span>

                </a>

            </li>

                <li>

                    <a href="">

                        <span class="aboutus-gry"></span>

                        <span>关于我们</span>

                    </a>

            </li>

                <li>

                    <a href="">

                    <span class="kefu-gry"></span>

                    <span>服务建设</span>

                </a>

            </li>

                <li><a href="">

                    <span class="chanpin-gry"></span>

                    <span>产品中心</span>

                </a>

            </li>

                <li><a href="">

                    <span class="fuwu-gry"></span>

                    <span>服务大厅</span>

                </a>

            </li>

            </ul>

        </nav>

   </section>

</body>

</html>

相关截图:

http://img.mukewang.com/climg/60f629b809436dec19200266.jpg

写回答

1回答

好帮手慕星星

2021-07-20

同学你好,代码问题:

1、‘关于我们’中类名写错了,多了一个u,导致图标不显示,修改如下

http://img.mukewang.com/climg/60f6628509f5024f06020157.jpg

2、移入的时候改变背景色用的是background,这是总属性,这样就把设置的背景图覆盖了。建议只设置背景色

http://img.mukewang.com/climg/60f662c109be059d05420197.jpg

祝学习愉快!

0

0 学习 · 15276 问题

查看课程