麻烦老师帮忙看下代码是否有问题 谢谢

来源:4-3 小慕医生项目开发(3)

夜的解忧铺

2021-07-15 23:25:25

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

<header>

        <div class="header-top">

            <!-- 网页的logo -->

            <div class="logo">

                <h1>小慕医生</h1>

            </div>


             <!-- 网页的功能区 -->

            <div class="tool">

                <div class="r1">

                    <img class="tel" src="images/tel.png" alt="">

                    <span class="telnumber">088-88888888</span>

                    <a href=""> <img class="chinese_icon icon" src="images/chinese_icon.png" alt=""></a>

                    <a href=""><img class="english_icon icon" src="images/english_icon.png" alt=""></a>

                </div>

                <div class="r2">

                    <input type="text"/ placeholder="找医生/科室..">

                    <button><img src="images/search.png" alt=""></button>

                </div>

            </div>

        </div>

        <!-- 网页的导航条 -->

        <nav class="main-nav">

            <ul>

                <li class="first">首页</li>

                <li>医院概况</li>

                <li>医院动态</li>

                <li>专家学科</li>

                <li>服务指南</li>

                <li>医院文化</li>

                <li>信息公开</li>

                <li>互动交流</li>

            </ul>

        </nav>

    </header>



.header-top::after{

    content'';

    clearboth;

    displayblock;

}

header .header-top{

    width1199px;

    margin0 auto;

    

}

header .header-top .logo{

    padding-top39px;

    width192px;

    height63px;

    floatleft;

}

header .header-top .logo h1{

    width192px;

    height63px;

}

header .header-top .tool{

    width266px;

    height67px;

    floatright;

    padding-top32px;

}

header .header-top .tool .r1{

    margin-bottom10px;


}

header .header-top .tool .r1 .tel{

    width32px;

    height25px;

}

header .header-top .tool .r1 .telnumber{

    font-size20px;

    color#00978E;

    displayinline-block;

    width158px;

    height26px;

    text-aligncenter;


}

header .header-top .tool .r1 .icon{

    width24px;

    height24px;   

}

header .header-top .tool .r1 .chinese_icon{

    margin-right16px;

}

header .header-top .tool .r2{

    width264px;

    height28px;

    border1px solid rgba(202,202,202,.6);

}

header .header-top .tool .r2 input{

    floatleft;

    /* 去掉边框线 */

    bordernone;

    width224px;

    height28px;

    font-size16px;

    padding-left20px;

    /* 去掉鼠标点击时的蓝色外围线 */

    outline:none;

}

header .header-top .tool .r2 button{

    floatright;

    width20px;

    height20px;

    /* 去掉背景 */

    backgroundnone;

    /* 去掉边框 */

    bordernone;

     /* 去掉鼠标点击时的蓝色外围线 */

     outlinenone;

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

     cursorpointer;

     /* 相对定位来微调位置 */

     positionrelative;

     top:4px;

     right4px;

}

header .main-nav{

    /* 这里不用写宽度,直接贯穿屏幕 只写高度 */

    height:60px ;

    background-color#00978E;

    margin-top29px;

}

header .main-nav ul{

    width1200px;

    height60px;

    margin0 auto;

}

header .main-nav ul li{

    floatleft;

    width150px;

    height60px;

    text-aligncenter;

    line-height60px;

    colorwhite;

    cursorpointer;

}

header .main-nav ul li.first{

    background-color#015E58;

}

1 为什么不设置宽度 没有贯穿 反而拖动滚动条 会出现空白 没有全部填充满

写回答

1回答

好帮手慕星星

2021-07-16

同学你好,代码实现效果没问题。

另外指的是哪里不设置宽度呢?老师没有复现出问题

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

建议将有问题的代码粘贴上来,老师帮助测试下。

祝学习愉快!

0

0 学习 · 15276 问题

查看课程