老师还可以优化吗

来源:3-17 编程练习

慕田峪8130438

2021-09-07 10:50:24

<!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>

    <style>

        * {

            margin0;

            padding0;

        }

        

        header {

            displayflex;

            justify-contentspace-around;

            background-color#000;

        }

        

        header .logo img {

            displayblock;

        }

        

        header .nav {

            width500px;

            list-stylenone;

            displayinline-flex;

            color#fff;

            justify-contentspace-between;

            align-itemscenter;

        }

        

        header .login {

            width100px;

            displayflex;

            justify-contentspace-between;

            align-itemscenter;

        }

        

        header .login input {

            padding3px;

            background-colororange;

            color#fff;

            border0;

            border-radius2px;

        }

        

        section {

            displayflex;

            justify-contentspace-around;

            flex-wrapwrap;

        }

        

        .section {

            width40%;

            margin20px 0;

            height150px;

            background-colorrgb(116221224);

            border-radius10px;

            displayflex;

            justify-contentspace-around;

            align-itemscenter;

        }

        

        .box {

            height100%;

            displayflex;

            flex-directioncolumn;

            justify-contentspace-around;

        }

        

        .shopping {

            width100px;

            height30px;

            background-colororange;

            border-radius5px;

            displayflex;

            justify-contentcenter;

            align-itemscenter;

            color#fff;

            cursorpointer;

        }

    </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>《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>《HTML5月CSS3实现动态网页》</p>

                <div>适用人群:有html和css基础的童鞋</div>

                <div>费用:¥599</div>

            </div>

            <div class="shopping">

                <div class="btn">加入购物车</div>

            </div>

        </div>

    </section>

</body>


</html>


写回答

1回答

好帮手慕慕子

2021-09-07

同学你好,效果实现的很棒,代码也很简洁了,可以不用再优化了。祝学习愉快~

0

0 学习 · 15276 问题

查看课程