请老师检查看看代码是否有改正。谢谢。

来源:4-10 自由编程

慕斯卡2474635

2021-06-06 20:21:54

/* 图文混排区域 */

.picture-and-word {

    width100%;

    height760px;


}

.picture-and-word img {

    floatleft;

    width25%;

    height380px;

    display:block;

}

.picture-and-word .word {

    floatleft;

    width25%;

    height380px;

    background-color#07cbc9;

}

.picture-and-word .word h3 {

    margin-top20px;

    margin-left20px;

    margin-bottom30px;

    font-size24px;

    colorwhite;

}

.picture-and-word .word .one {

    margin-left20px;

    font-size16px;

    colorwhite;

    margin-bottom20px;

}

.picture-and-word .word .two {

    margin-left20px;

    font-size14px;

    colorgray;

    margin-bottom30px;

}

.picture-and-word .word button {

    displayblock;

    width138px;

    height40px;

    colorwhite;

    background-colorblack;

    text-aligncenter;

    margin0 auto;

}




 <!-- 图文混排区域 -->

    <div class="picture-and-word">

        <div class="picture">

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

        </div>

        <div class="word">

            <p>

                <h3>Library</h3>

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

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

                <button>EXPLORE</button>

            </p>

        </div>

        <div class="picture">

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

        </div>

        <div class="word">

            <h3>Library</h3>

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

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

            <button>EXPLORE</button>

        </div>

        <div class="word">

            <h3>Library</h3>

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

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

            <button>EXPLORE</button>

        </div>

        <div class="picture">

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

        </div>

        <div class="word">

            <h3>Library</h3>

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

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

            <button>EXPLORE</button>

        </div>

        <div class="picture">

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

        </div>

    </div>


写回答

1回答

好帮手慕星星

2021-06-07

同学你好,代码布局是可以的,样式还可以优化:

1、容器右侧也可以添加间距,避免文字紧挨着

http://img.mukewang.com/climg/60bd80640903ea9505480191.jpg

http://img.mukewang.com/climg/60bd809d09e8a9ae04320360.jpg

2、按钮默认有边框

http://img.mukewang.com/climg/60bd80b409987c0502540074.jpg

效果图中是没有的,可以去掉,看着美观一些

http://img.mukewang.com/climg/60bd80cf098f3aa603670247.jpg

祝学习愉快!

0

0 学习 · 15276 问题

查看课程