老师请检查

老师请检查

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

}

div.box{

    width: 100%;

    height: 760px;

}

.box .box1,.box3,.box6,.box8{

    width: 25%;

    height: 380px;

    float: left;

}

.box img{

    height: 380px;

    width: 100%;

}


.box .box2,.box4,.box5,.box7{

    background-color: rgb(0, 226, 215);

    width: 25%;

    height: 380px;

    float: left;

    color: white;


}

.text1{

    font-size: 24px;

    font-weight: bold;

    color: white;

    margin-top: 20px;

    margin-left: 20px;


}

.text2{

    margin-top: 30px;

    margin-left: 20px;

    font-size: 16px;

}

.text3{

    margin-top: 20px;

    margin-left: 20px;

    font-size: 14px;

    color: gray;

    margin-right: 20px;

}

.button{

    width: 138px;

    height: 40px;

    background-color: black;

    color: white;

    font-size: 16px;

    line-height: 40px;

    text-align: center;

    display: block;

    margin: 0 auto;

    margin-top: 30px;

    cursor: pointer;

   

   


}

    </style>

</head>


<body>

    <div class="box">

        <div class="box1">

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

        </div>

        <div class="box2">

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

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

            <p class="text3">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>

            <div class="button"><button>EXPLORE</button></div>

        </div>

        <div class="box3">

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

        </div>

        <div class="box4">

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

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

            <p class="text3">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>

            <div class="button"><button>EXPLORE</button></div>

        </div>

        <div class="box5">

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

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

            <p class="text3">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>

            <div class="button"><button>EXPLORE</button></div>

        </div>

        <div class="box6">

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

        </div>

        <div class="box7">

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

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

            <p class="text3">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>

            <div class="button"><button>EXPLORE</button></div>

        </div>

        <div class="box8">

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

        </div>

    </div>

</body>


</html>

相关截图:

https://img1.sycdn.imooc.com//climg/61a797a30966c3a602410105.jpg

相关截图:

相关截图:

相关截图:

相关截图:

搜索

复制

正在回答

登陆购买课程后可参与讨论,去登陆

1回答

同学你好,同学的结构写的很清晰,的确按照任务要求还原了作业,老师先赞一个~。

优化建议:

1、按钮样式。如下图:

https://img1.sycdn.imooc.com//climg/61a82cc409639b7403370093.jpg

优化方案,如下:

https://img1.sycdn.imooc.com//climg/61a82ce609233b5107720217.jpg

https://img1.sycdn.imooc.com//climg/61a82cf509a1148c05520382.jpg

其他的按钮,同学尝试用这个方法自己试试看。

2、 margin建议用缩写的形式,如下:

https://img1.sycdn.imooc.com//climg/61a82d0c09dfad0106800225.jpg

作业中还有类似可以优化的地方哦~,同学可以自己尝试优化一下哈~

祝学习愉快~

  • 阿惹 提问者 #1

    谢谢老师,可是优化之后,按钮的样式还没有实现黑底白字的效果。https://img1.sycdn.imooc.com//climg/61a8ad70097a0ca102490113.jpghttps://img1.sycdn.imooc.com//climg/61a8ad5a096d6ac602690094.jpg

    搜索

    复制

    2021-12-02 19:26:45
  • 好帮手慕小李 回复 提问者 阿惹 #2

    同学你好,上述第一点解答是可以实现需求的,同学把优化前与优化后的代码做一下对比,不难发现优化前是有div父级的,优化后是去掉div父级的,且原有的div类名直接挪到了button标签上,如下图:

    https://img1.sycdn.imooc.com//climg/61a978ec0938306b11000174.jpg

    https://img1.sycdn.imooc.com//climg/61a9780409e58fac05330374.jpg

    最终实现效果:

    https://img1.sycdn.imooc.com//climg/61a978410921b18409600380.jpg

    页面中类似的按钮,同学自己改一改试试哈~祝学习愉快~

    2021-12-03 09:55:41
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师