请老师检查

来源:3-17 编程练习

芜湖呼

2022-04-03 18:56:55

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
     /* 在此处补充代码*/
     *{
         margin: 0;
         padding: 0;
     }
     header{
         display: flex;
         width:100%;
         background: black;
         justify-content: space-around;
         align-items: center;
     }
     header .nav {
         list-style: none;
         display: flex;
         width: 500px;
         justify-content: space-around;
         color: white;
     }
     header .login input{
         background: orange;
         border:none;
         color: white;
         border-radius: 2px;
         margin-right: 10px;
         padding: 5px;
     }
     header .login input:last-child{
         margin-right: 0;
     }
     section{
         display: flex;
         flex-wrap: wrap;
         justify-content: space-around;
         
     }
     section .section{
         display: flex;
         width:600px;
         height: 150px;
         background: blue;
         margin: 10px 0;
         justify-content: space-around;
         align-items: center;
     }
     section .section .box{
         height: 100%;
         display: flex;
         flex-direction: column;
         justify-content: space-around;
     }
     section .section .shopping .btn{
         background: orange;
         color: white;
         padding: 5px;
     }
    </style>
</head>
<body>
<!-- 头部 -->
   <header>
     <div class="logo">
       <img src="http://climg.mukewang.com/59197ab000014f1503000100.jpg" alt="">
     </div>
       <ul class="nav">
         <li>课程</li>
         <li>路径</li>
         <li>猿问</li>
         <li>手记</li>
       </ul>     
     <div class="login">
       <input type="button" value="登录">
       <input type="button" value="注册">
     </div>
   </header>
<!-- 主体内容 -->
   <section>
    <div class="section">
      <div class="box">
        <p>《前端小白入门手册》</p>
        <div>适用人群:没有任何前端基础的小白</div>
        <div>费用:¥499</div>
      </div>
      <div class="shopping">
        <div class="btn">加入购物车</div>
      </div>
    </div>
    <div class="section">
      <div class="box">
        <p>《HTML5月CSS3实现动态网页》</p>
        <div>适用人群:有html和css基础的童鞋</div>
        <div>费用:¥599</div>
      </div>
      <div class="shopping">
        <div class="btn">加入购物车</div>
      </div>
    </div>
    <div class="section">
      <div class="box">
        <p>《前端小白入门手册》</p>
        <div>适用人群:没有任何前端基础的小白</div>
        <div>费用:¥499</div>
      </div>
      <div class="shopping">
        <div class="btn">加入购物车</div>
      </div>
    </div>
    <div class="section">
      <div class="box">
        <p>《前端小白入门手册》</p>
        <div>适用人群:没有任何前端基础的小白</div>
        <div>费用:¥499</div>
      </div>
      <div class="shopping">
        <div class="btn">加入购物车</div>
      </div>
    </div>
    </section>  
</body>
</html>

一般使用什么软件来测出颜色

写回答

1回答

好帮手慕星星

2022-04-04

同学你好,代码优化如下:

1、logo图与父盒子之间有间隙

https://img.mukewang.com/climg/624a5c26095acc5806280172.jpg

是因为图片为行内元素,有文字特性,默认存在间隙。可以将图片设置为块元素

https://img.mukewang.com/climg/624a5e1109e450f504640176.jpg

2、下面盒子间距有些大了,每个小盒子设置的是固定宽度,显示器分辨率越大,间距就会越大

https://img.mukewang.com/climg/624a5d5909d1d8ee25590545.jpg

建议修改宽度为百分比,并添加圆角效果

https://img.mukewang.com/climg/624a5fc309c1c3c906340395.jpg

里面的按钮也建议添加圆角效果

https://img.mukewang.com/climg/624a5fe90962627c09300311.jpg

3、检测颜色的简单方式,打开电脑自带画图工具,截图将图片粘贴到工具中,用“取色器”吸取颜色,然后点击“编辑颜色”

https://img.mukewang.com/climg/624a5f720929d27815870936.jpg

使用rgb的值即可

https://img.mukewang.com/climg/624a606609bd266809080181.jpg

祝学习愉快!

0

0 学习 · 15276 问题

查看课程