请老师检查代码是否正确

来源:2-17 自由编程

DanteSu

2021-08-15 00:57:54

<!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>Document</title>

    <style>

        *{

            margin:0;

            padding:0;

        }

        .main{

            width100%;

        }


        .m1{

            floatleft;

            width25%;

            height380px;

            margin-right:0;

        }


        img{

            displayblock;

            width100%;

            height100%;

        }


        .m2{

            floatleft;

            width25%;

            height380px;

            background#07cbc9;

            positionrelative;

        }


        .p1{

            font-size24px;

            padding-top20px;

            margin-bottom30px;

            padding-left20px;

        }


        .p2{

            font-size16px;

            colorwhite;

            margin-bottom20px;

            padding-left20px;

        }


        .p3{

            font-size14px;

            color:gray;

            margin-bottom30px;

            padding-left20px;

        }


        input{

            displayblock;

            width138px;

            height40px;

            bordernone;

            colorwhite;

            background-colorblack;

            line-height40px;

            margin0 auto;

        }


        .top::before{

            content"";

            width0;

            height0;

            border20px solid transparent;

            border-right-color#07cbc9;

            top170px;

            right100%;

            positionabsolute;

        }


        .bottom::before{

            content"";

            width0;

            height0;

            border20px solid transparent;

            border-left-color#07cbc9;

            top170px;

            left100%;

            positionabsolute;

        }


        

    </style>

</head>

<body>

    <div class='main'>

        <div class="m1">

            <img src="./images/b1.jpg" alt="">

        </div>

        <div class="m2 top">

            <p class="p1">Library</p>

            <p class="p2">Lorem Ipsum is simply dummy text of the printing and typesetting

                industry</p>

            <p class="p3">

                Lorem Ipsum has been the industry's standard dummy text ever since

                the 1500s, when an unknown printer took a galley of type and

                scrambled it to make a type specimen book.

            </p>

            <input type="submit" value="EXPLORE">

        </div>

        <div class="m1">

            <img src="./images/b2.jpg" alt="">

        </div>

        <div class="m2 top">

            <p class="p1">Library</p>

            <p class="p2">Lorem Ipsum is simply dummy text of the printing and typesetting

                industry</p>

            <p class="p3">

                Lorem Ipsum has been the industry's standard dummy text ever since

                the 1500s, when an unknown printer took a galley of type and

                scrambled it to make a type specimen book.

            </p>

            <input type="submit" value="EXPLORE">

        </div>

        <div class="m2 bottom">

            <p class="p1">Library</p>

            <p class="p2">Lorem Ipsum is simply dummy text of the printing and typesetting

                industry</p>

            <p class="p3">

                Lorem Ipsum has been the industry's standard dummy text ever since

                the 1500s, when an unknown printer took a galley of type and

                scrambled it to make a type specimen book.

            </p>

            <input type="submit" value="EXPLORE">

        </div>

        <div class="m1">

            <img src="./images/b3.jpg" alt="">

        </div>

        <div class="m2 bottom">

            <p class="p1">Library</p>

            <p class="p2">Lorem Ipsum is simply dummy text of the printing and typesetting

                industry</p>

            <p class="p3">

                Lorem Ipsum has been the industry's standard dummy text ever since

                the 1500s, when an unknown printer took a galley of type and

                scrambled it to make a type specimen book.

            </p>

            <input type="submit" value="EXPLORE">

        </div>

        <div class="m1">

            <img src="./images/b4.jpg" alt="">

        </div>

    </div>

</body>

</html>


写回答

1回答

樱桃小胖子

2021-08-15

同学你好,建议对代码进行一下优化,相同的代码合并书写,这样不仅能提升代码质量,还能提升编码效率。参考如下:

http://img.mukewang.com/climg/61187dfd09199bd505810789.jpg

希望可以帮到你,祝学习愉快!

0

0 学习 · 15276 问题

查看课程