请老师检查代码是否正确

来源:4-10 自由编程

DanteSu

2021-08-12 22:10:25

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

        }


        .m2{

            floatleft;

            width25%;

            height380px;

            background#07cbc9;


        }


        .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;

        }


        

    </style>

</head>

<body>

    <div class='main'>

        <div class="m1">

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

        </div>

        <div class="m2">

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

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

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

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

同学你好,可以看到有图片超出了

http://img.mukewang.com/climg/6115d4c3095845a719200900.jpg

这是电脑分辨率的原因,图片设置宽度为100%,高度会按照自身宽高比进行显示。如果分辨率越大,25%计算宽度也越大,所以图片宽度越大,高度也就越大,导致超出。

建议设置图片固定高度

http://img.mukewang.com/climg/6115d6d9096ad84c02910179.jpg

其他样式是可以的,祝学习愉快!

0

0 学习 · 15276 问题

查看课程