老师帮我检查一下作业

来源:3-3 编程练习

艳艳子

2022-07-23 20:29:34

老师这里是怎么回事

https://img.mukewang.com/climg/62dbe99d0944443506250276.jpg

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
        /* 在此处补充代码*/
        header {
            display: flex;
            align-items: center;
            justify-content: space-around;
            width: 100%;
            height: 70px;
            background-color: black;
        }

        header .logo img{
            height: 70px;
            display: flex;
            align-items: center;
        }

        header .nav {
            width: 30%;
            display: flex;
            justify-content: space-around;
            align-items: center;
            list-style: none;
        }

        header .nav li {
            color: white;
        }

        header .login {
            display: flex;
            width: 10%;
            justify-content: space-around;
        }

        header .login input {
            background-color: orange;
            color: white;
            border-radius: 5px;
            outline: none;
        }

        section {
            height: 300px;

            display: flex;
            flex-wrap: wrap;
            justify-content: space-around;
        }

        section .section {
            margin-top: 20px;
            width: 45%;
            background-color: lightblue;
            border-radius: 10px;
            display: flex;
            justify-content: space-around;
            align-items: center;

        }

        section .section .box {
            display: flex;
            height: 100%;
            flex-direction: column;
            justify-content: space-around;
            align-items: flex-start;
        }

        section .section .shopping {
            width: 90px;
            background-color: orange;
            color: white;
            border-radius: 5px;
            display: flex;
            justify-content: center;
            align-items: center;
        }
    </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>《从H5网页开发到移动端响应式开发》</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-07-24

同学你好,问题解答如下:

1、因为p标签有默认的外边距,导致文字间距不同,如下:

https://img.mukewang.com/climg/62dca7ef09d0549a16210870.jpg

建议修改:可以直接使用通配符,去除所有元素的默认内外边距。

https://img.mukewang.com/climg/62dca84f097adfb802780119.jpg

2、文字周围没有空白间距,效果不美观,如下图所示:

https://img.mukewang.com/climg/62dca88209586b0215390364.jpg

建议优化:适当添加内边距,调整文字周围空白间距。示例:

https://img.mukewang.com/climg/62dca8c309e0abf804270207.jpg

https://img.mukewang.com/climg/62dca8d00990154f05220276.jpg

祝学习愉快~

0

0 学习 · 17877 问题

查看课程