关于利用浮动实现复杂图文练习

关于如何利用浮动实现复杂图文练习

复杂图文练习1

在这里插入图片描述
实现代码段如下

<!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>work3</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .item {
            width: 852px;
            height: 152px;
            background-color: #fff;
            padding: 0 5px;
            border-bottom: 1px solid grey;
        }

        .item .wrap {
            width: 660px;
            height: 152px;
            float: left;
        }

        .wrap .title {
            height: 40px;
            line-height: 40px;
            font-size: 18px;
            margin-top: 20px;
            font-weight: 900;
            color: black;
        }

        .item .wrap .content {
            height: 44px;
            width: 660px;
            line-height: 22px;
            font-size: 16px;
            color: #a8a8a8;
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
        }

        .item .bottom {
            height: 48px;
            font-size: 14px;
            color: #a8a8a8;
        }

        .item .bottom .itemm {
            float: left;
            margin-right: 22px;
        }

        .item .bottom .itemm img {
            height: 14px;
            margin-right: 8px;
            margin-top: 17px;
            float: left;
        }

        .item .bottom .itemm p {
            font-size: 14px;
            height: 48px;
            line-height: 48px;
            color: #a8a8a8;
            float: left;
        }

        .item .right {
            height: 100px;
            width: 152px;
            float: right;
            margin-top: 26px;
            border-radius: 4px;
        }
    </style>
</head>

<body>
    <div class="item">
        <div class="wrap">
            <p class="title">你有没有想过,帮助孩子正确认识死亡!!</p>
            <p class="content">
                死亡,一直是一个很严肃的话题,父母很少去和孩子谈死亡,怕让孩子心里有压力死亡,一直是一个很严肃的话题,父母很少去和孩子谈死亡,怕让孩子心里有压力死亡,一直是一个很严肃的话题,父母很少去和孩子谈死亡,怕让孩子心里有压力死亡,一直是一个很严肃的话题,父母很少去和孩子谈死亡,怕让孩子心里有压力
            </p>
            <div class="bottom">
                <div class="itemm">
                    <img src="./img/look.png" alt="">
                    <p>1338</p>
                </div>
                <div class="itemm">
                    <img src="./img/like.png" alt="">
                    <p>1</p>
                </div>
                <div class="itemm">
                    <img src="./img/pl.png" alt="">
                    <p>0</p>
                </div>
                <div class="itemm">
                    <img src="./img/circle.png" alt="">
                    <p style="color: #ff819b;">情感交流</p>
                </div>
            </div>
        </div>
        <img src="./img/1.webp" alt="" class="right">
    </div>
    <div class="item">
        <div class="wrap">
            <p class="title">小孩到底是放养好还是精养好?</p>
            <p class="content">
                死亡,一直是一个很严肃的话题,父母很少去和孩子谈死亡,怕让孩子心里有压力死亡,一直是一个很严肃的话题,父母很少去和孩子谈死亡,怕让孩子心里有压力死亡,一直是一个很严肃的话题,父母很少去和孩子谈死亡,怕让孩子心里有压力死亡,一直是一个很严肃的话题,父母很少去和孩子谈死亡,怕让孩子心里有压力
            </p>
            <div class="bottom">
                <div class="itemm">
                    <img src="./img/look.png" alt="">
                    <p>1338</p>
                </div>
                <div class="itemm">
                    <img src="./img/like.png" alt="">
                    <p>3</p>
                </div>
                <div class="itemm">
                    <img src="./img/pl.png" alt="">
                    <p>0</p>
                </div>
                <div class="itemm">
                    <img src="./img/circle.png" alt="">
                    <p style="color: #ff819b;">情感交流</p>
                </div>
            </div>
        </div>
        <img src="./img/2.webp" alt="" class="right">
    </div>
</body>

</html>

复杂图文练习2

在这里插入图片描述
实现代码段如下

<!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>work4</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .wrap {
            height: 410px;
            width: 220px;
            border: 1px solid lightgray;
            margin: 20px 10px 20px 10px;
            border-radius: 5px;
            float: left;
        }
        .wrap .big {
            height: 296px;
            width: 220px;
            border-top-left-radius: 5px;
            border-top-right-radius: 5px;
        }
        .wrap .title {
            height: 60px;
            line-height: 30px;
            margin-top: 10px;
            font-size: 16px;
            width: 176px;
            margin-left: 14px;
            color: black;
            font-weight: 500;
        }
        .bottom {
            height: 40px;
            width: 220px;
            color: gray;
        }
        .bottom .item1 {
            margin-left: 14px;
            height: 40px;
            float: left;
        }
        .bottom .item1 img {
            height: 30px;
            border-radius: 50%;
            margin-top: 5px;
            float: left;
        }
        .bottom .item1 p {
            height: 40px;
            line-height: 40px;
            font-size: 14px;
            margin-left: 8px;
            float: left;
        }
        .bottom .item2 {
            margin-right: 10px;
            height: 40px;
            float: right;
        }
        .bottom .item2 img {
            height: 16px;
            margin-top: 12px;
            float: left;
        }
        .bottom .item2 p {
            height: 40px;
            line-height: 40px;
            font-size: 14px;
            margin-left: 8px;
            float: left;
        }
    </style>
</head>
<body>
    <div class="wrap">
        <img class="big" src="./img/1.jpg" alt="">
        <p class="title">干货分享<span>|</span>夏日其平衡车暴汗怎么穿</p>
        <div class="bottom">
            <div class="item1">
                <img src="./img/6.jpg" alt="">
                <p>全能辣妈YuLi咯</p>
            </div>
            <div class="item2">
                <img src="./img/like.png" alt="">
                <p>96</p>
            </div>
        </div>
    </div>
    <div class="wrap">
        <img class="big" src="./img/2.jpg" alt="">
        <p class="title">Lifestyle<span>|</span>共赴灿烂夏日,一起去野餐吧!</p>
        <div class="bottom">
            <div class="item1">
                <img src="./img/7.jpg" alt="">
                <p>YuKi旅行日记</p>
            </div>
            <div class="item2">
                <img src="./img/like.png" alt="">
                <p>136</p>
            </div>
        </div>
    </div>
    <div class="wrap">
        <img class="big" src="./img/3.jpg" alt="">
        <p class="title">移动办公利器<span>|</span>惠普战x鼠标真香!</p>
        <div class="bottom">
            <div class="item1">
                <img src="./img/8.jpg" alt="">
                <p>Arron阿伊</p>
            </div>
            <div class="item2">
                <img src="./img/like.png" alt="">
                <p>96</p>
            </div>
        </div>
    </div>
    <div class="wrap">
        <img class="big" src="./img/4.jpg" alt="">
        <p class="title">一个懂父母的孩子才能教育出优秀的孩子</p>
        <div class="bottom">
            <div class="item1">
                <img src="./img/9.jpg" alt="">
                <p>大汉堡小可乐</p>
            </div>
            <div class="item2">
                <img src="./img/like.png" alt="">
                <p>96</p>
            </div>
        </div>
    </div>
    <div class="wrap">
        <img class="big" src="./img/5.jpg" alt="">
        <p class="title">杭州看展<span>|</span>非物质文化遗产花丝工艺展</p>
        <div class="bottom">
            <div class="item1">
                <img src="./img/10.jpg" alt="">
                <p>全能辣妈YuLi咯</p>
            </div>
            <div class="item2">
                <img src="./img/like.png" alt="">
                <p>96</p>
            </div>
        </div>
    </div>
</body>
</html>

复杂图文练习3在这里插入图片描述实现代码段如下

<!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>work5</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .wrap {
            height: 200px;
            width: 680px;
            margin-top: 20px;
            margin-left: 15px;
        }
        .wrap .title {
            height: 50px;
            line-height: 50px;
            font-style: 24px;
            color: black;
            font-weight: 700;
            letter-spacing: 3px;
        }
        .wrap .img {
            height: 118px;
            font-weight: 680px;
        }
        .wrap .img img {
            height: 118px;
            width: 158px;
            margin-left: 16px;
            float: left;
            border-radius: 3px;
        }
        .wrap .bottom {
            height: 32px;
        }
        .wrap .bottom {
            height: 32px;
            line-height: 32px;
            font-size: 14px;
            color: gray;
        }
        .wrap .bottom p {
            float: left;
            margin-right: 20px;
        }
    </style>
</head>
<body>
    <div class="wrap" style="margin-top: 0;">
        <p class="title">油价调整消息。今天4月18日,全国油价调整后92,95号汽油价格</p>
        <div class="img">
            <img style="margin-left: 0;" src="./img/1.jpg" alt="">
            <img src="./img/2.jpg" alt="">
            <img src="./img/3.jpg" alt="">
            <img src="./img/4.jpg" alt="">
        </div>
        <div class="bottom">
            <p>每日财经整合</p>
            <p>199评论</p>
            <p>17小时前</p>
        </div>
    </div>
    <div class="wrap">
        <p class="title">汪涵和杨乐乐,半路夫妻有笑也有泪,最担心的是儿子的成长</p>
        <div class="img">
            <img style="margin-left: 0;" src="./img/5.jpg" alt="">
            <img src="./img/6.jpg" alt="">
            <img src="./img/7.jpg" alt="">
            <img src="./img/8.jpg" alt="">
        </div>
        <div class="bottom">
            <p>娱人故事</p>
            <p>199评论</p>
            <p>02月25日</p>
        </div>
    </div>
</body>
</html>

复杂图文练习4

在这里插入图片描述
实现代码段如下

<!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;
        }
        .wrap {
            height: 200px;
            width: 388px;
            border: 1px solid lightgray;
            float: left;
            margin: 8px;
        }
        .wrap .top {
            height: 18px;
            line-height: 18px;
            margin-top: 26px;
            width: 356px;
            margin-left: 16px;
        }
        .wrap .top .title {
            font-size: 18px;
            color: black;
            font-weight: 400;
            float: left;
        }
        .wrap .top .time {
            font-size: 16px;
            color: lightgray;
            margin-left: 12px;
            float: left;
        }
        .wrap .top .price {
            font-size: 18px;
            color: tomato;
            float: right;
        }
        .wrap .content {
            height: 16px;
            line-height: 16px;
            margin-top: 16px;
            margin-left: 16px;
            color: gray;
        }
        .wrap .tap {
            height: 64px;
            width: 356px;
            margin-left: 16px;
            border-bottom: 1px dotted gray;
        }
        .wrap .tap p {
            height: 28px;
            line-height: 28px;
            margin-top: 18px;
            font-size: 14px;
            color: gray;
            width: 62px;
            border: 1px solid lightgray;
            border-radius: 2px;
            margin-left: 12px;
            text-align: center;
            float: left;
        }
        .wrap .bottom {
            width: 356px;
            height: 58px;
            margin-left: 16px;
        }
        .wrap .bottom img {
            height: 42px;
            margin-top: 8px;
            float: left;
            border-radius: 2px;
        }
        .wrap .bottom .right {
            height: 42px;
            margin-top: 8px;
            margin-left: 15px;
            font-size: 16px;
            float: left;
        }
        .wrap .bottom .right .name {
            height: 21px;
            line-height: 21px;
            color: lightgreen;
        }
        .wrap .bottom .right .type {
            color: gray;
        }
    </style>
</head>

<body>
    <div class="wrap">
        <div class="top">
            <p class="title">储备营业处...</p>
            <p class="time">[1天前发布]</p>
            <p class="price">25k-50k</p>
        </div>
        <p class="content">经验3-5年&nbsp;/&nbsp;本科</p>
        <div class="tap">
            <p style="margin-left: 0;">科技金融</p>
            <p>旅游&nbsp;|&nbsp;...</p>
            <p>TO C</p>
        </div>
        <div class="bottom">
            <img src="./img/1.png" alt="">
            <div class="right">
                <p class="name">中美大都会</p>
                <p class="type">金融业&nbsp;/&nbsp;上市公司&nbsp;/&nbsp;北京</p>
            </div>
        </div>
    </div>
    <div class="wrap">
        <div class="top">
            <p class="title">产品经理</p>
            <p class="time">[1天前发布]</p>
            <p class="price">11k-16k.13薪</p>
        </div>
        <p class="content">经验1-3年&nbsp;/&nbsp;大专</p>
        <div class="tap">
            <p style="margin-left: 0;">软件服...</p>
            <p>人工智...</p>
            <p>广告产品</p>
        </div>
        <div class="bottom">
            <img src="./img/2.png" alt="">
            <div class="right">
                <p class="name">微媒</p>
                <p class="type">社交媒体&nbsp;/&nbsp;未融资&nbsp;/&nbsp;杭州</p>
            </div>
        </div>
    </div>
    <div class="wrap">
        <div class="top">
            <p class="title">用户运营经理</p>
            <p class="time">[1天前发布]</p>
            <p class="price">14k-24k.16薪</p>
        </div>
        <p class="content">经验3-5年&nbsp;/&nbsp;本科</p>
        <div class="tap">
            <p style="margin-left: 0;">科技金融</p>
            <p>TO&nbsp;C</p>
            <p>用户运营</p>
        </div>
        <div class="bottom">
            <img src="./img/3.png" alt="">
            <div class="right">
                <p class="name">度小满</p>
                <p class="type">专业服务&nbsp;/&nbsp;咨询&nbsp;/&nbsp;A轮&nbsp;/&nbsp;北京</p>
            </div>
        </div>
    </div>
</body>

</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值