作业练习提交

来源:2-4 编程练习

慕前端1500838

2020-06-22 19:45:08

<!DOCTYPE html>

<html>

<head>

  <meta charset="UTF-8">

  <title></title>

  <style type="text/css">

    /*此处写代码*/

    *{padding:0;margin:0;}

    .nav{

        width:1100px;

        height:100px;

        background:black;

        overflow:hidden;

        zoom:1

        /*position:absolute;*/

    }

    

    .img{

        width:300px;

        height:100px;

        background:url(http://climg.mukewang.com/58c0d2d900016ce303000100.png) ;

        float:left;

    }

    

    .title{

        color:#ffffff;

        position:relative;

    }

    

    .title ul{

        list-style-type:none;

        overflow:hidden;

        zoom:1

        height:100px;

        line-height:100px;

        position:absolute;

        right:0;

        

    }

    

    .title ul li{

        float:left;

        padding-right:30px;

    }

  </style>

</head>

<body>

  <!-- 此处写代码 -->

  <div class="nav">

      <div class="img"></div>

      <div class="title">

          <ul>

              <li>课程</li>

              <li>职业路径</li>

              <li>实战</li>

              <li>猿问</li>

              <li>手记</li>

          </ul>

      </div>

  </div>

</body>

</html>


写回答

1回答

好帮手慕星星

2020-06-23

同学你好,代码中问题如下:

1、样式存在问题,编辑器出现了波浪线提示

http://img.mukewang.com/climg/5ef15c9109972ce205360335.jpg

zoom属性结尾缺少分号导致的,添加上就好。

2、导航条在页面上没有水平垂直居中显示

http://img.mukewang.com/climg/5ef15cbf098e90db25390633.jpg

需要使用定位完成,参考

http://img.mukewang.com/climg/5ef15d22095c54ad06140544.jpg

自己再测试下,祝学习愉快!

0

0 学习 · 40143 问题

查看课程