请老师检查一下我的代码有没有什么需要修改的地方,谢谢~

请老师检查一下我的代码有没有什么需要修改的地方,谢谢~

<!-- 图文混排区域 -->
    <!-- Img&text -->
    <section class="img-text">
        <div class="img">
            <img src="./images/b1.jpg" alt="">
        </div>
        <div class="text texta">
            <h3>Library</h3>
            <p class="p1">
                Lorem Ipsum is simply dummy text of the printing and typesetting industry
            </p>
            <p class="p2">
                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>
            <a href="">EXPLORE</a>
        </div>
        <div class="img">
            <img src="./images/b2.jpg" alt="">
        </div>
        <div class="text texta">
            <h3>Library</h3>
            <p class="p1">
                Lorem Ipsum is simply dummy text of the printing and typesetting industry
            </p>
            <p class="p2">
                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>
            <a href="">EXPLORE</a>
        </div>
        <div class="text textb">
            <h3>Library</h3>
            <p class="p1">
                Lorem Ipsum is simply dummy text of the printing and typesetting industry
            </p>
            <p class="p2">
                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>
            <a href="">EXPLORE</a>
        </div>
        <div class="img">
            <img src="./images/b3.jpg" alt="">
        </div>
        <div class="text textb">
            <h3>Library</h3>
            <p class="p1">
                Lorem Ipsum is simply dummy text of the printing and typesetting industry
            </p>
            <p class="p2">
                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>
            <a href="">EXPLORE</a>
        </div>
        <div class="img">
            <img src="./images/b4.jpg" alt="">
        </div>
    </section>
/* 图文混排区域 */
.img-text {
    width: 100%;
    margin-top: 20px;
}
.img-text div {
    width: 25%;
    height: 380px;
    background-color: #07cbc9;
    float: left;
}
.img-text .img img {
    height: 100%;
    width: 100%;
}
.img-text .text {
    position: relative;
}
.img-text .texta::before {
    content:' ';
    width: 0;
    height: 0;
    border: 20px solid transparent;
    border-right-color: #07cbc9;
    position: absolute;
    /* top: 50%; */
    /* left: -90px; */
    top: 190px;
    margin-top: -10px;
    left: -40px;
}
.img-text .textb::after {
    content:' ';
    width: 0;
    height: 0;
    border: 20px solid transparent;
    border-left-color: #07cbc9;
    position: absolute;
    /* top: 50%; */
    /* left: -90px; */
    top: 190px;
    margin-top: -10px;
    right: -40px;
}
.img-text .text h3 {
    font-size: 24px;
    color: white;
    margin-bottom: 30px;
    margin-top: 20px;
    margin-left: 20px;
}
.img-text .text .p1 {
    margin-left: 20px;
    margin-top: 30px;
    margin-bottom: 30px;
    font-size: 16px;
    color: #fff;
}
.img-text .text .p2 {
    color: gray;
    margin-left: 20px;
    font-size: 14px;
    margin-bottom: 30px;
}
.img-text .text a {
    display: block;
    width: 138px;
    height: 40px;
    background-color: #000;
    color: white;
    line-height: 40px;
    text-align: center;
    margin: 0 auto;
}

正在回答

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

1回答

同学你好,代码实现效果还可以,基本没问题,存在以下几处细节建议优化一下,如图

http://img1.sycdn.imooc.com//climg/608a6e1c09cd71b705470332.jpg

http://img1.sycdn.imooc.com//climg/608a6e1c09a0745d05270453.jpg

http://img1.sycdn.imooc.com//climg/608a6e1c091be7cf06620512.jpg

​祝学习愉快!

  • lascride 提问者 #1

    好的. 谢谢老师的指点! 的确优化后的代码更简洁, 更易于理解了~

    2021-04-29 16:31:11
问题已解决,确定采纳
还有疑问,暂不采纳

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

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

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

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