两个案例练练手

文章内容展示了两个HTML和CSS的代码示例,一个是抖音直播SDK的看播组件,另一个是新闻列表的设计,包括样式和链接功能。
摘要由CSDN通过智能技术生成

文章目录

案例一

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body{
            background-color: #f1f1f1;
        }

        .product{
            width: 270px;
            height: 255px;
            background-color: #ffff;

            margin: 50px auto;

            border-radius: 10px;

            padding: 40px;
            text-align: center;


        }

        .tu{
            padding-left: 50px;
            padding-right: 50px;
        }

        .product h4{
            font-size: 18px;
            color: #333;
            font-weight: 400;
            margin-top:20px ;
            margin-bottom: 12px;
        }

        .product p{
            font-size: 12px;
            color: #555;
        }
    </style>
</head>
<body>
    <div class="product">
        <img src="./liveSDK.svg" alt="" class="tu">
        <h4>抖音直播SDK</h4>
        <p>包含抖音直播看播功能</p>

    </div>
    
</body>
</html>

结果
在这里插入图片描述

案例二

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;           
             text-decoration: none;

        }
        .new{
            width: 300px;
            height: 280px;
            background-color: white;
            margin: 50px auto;
        }

        .new .hd{
            height: 30px;
            background-color: #e7e2e2;
            border: 1px solid #b3b1b1;
            border-left: 0;
        }
        .new .hd a{
            display: block;
            width: 50px;
            height: 30px;
            background-color: #fff;
            border-top: 4px solid #f0951dfe;
            border-right:1px solid #b3b1b1;
            margin-top: -1px;


            color: black;
            text-align: center;
            line-height: 30px;
            font-size: 12px;
        }
        
        .new .bd ul{
            list-style: none;
        }

        .new .bd ul li{

            background-image: url(./square.png);
            background-position: 12px center;
            background-repeat: no-repeat;
            padding-left:12px ;
        }
        .new .bd ul li a{
            display: block;
            background-image: url(./img.gif);
            background-position: 12px center;
            background-repeat: no-repeat;
            padding-left: 48px;

            text-decoration: none;
            color: darkgrey;
            font-weight: 200;
            font-size: 12px;
        }
        .new .bd ul li a:hover{
            color: orange;
        }
        
    </style>
</head>
<body>

    <div class="new">
        <div class="hd"><a href="">新闻</a></div>

        <div class="bd"><ul>
            <li><a href="#">点赞“新农人” 温暖的伸手</a></li>
            <li><a href="#">在希望的田野上...</a></li>
            <li><a href="#">“中国天眼”又有新发现 已在《自然》杂志发表</a></li>
            <li><a href="#">急!这个领域,缺人!月薪4万元还不好招!啥情况?</a></li>
            <li><a href="#">G9“带货”背后:亏损面持续扩大,竞争环境激烈</a></li>
            <li><a href="#">多地力推二手房“带押过户”,有什么好处?</a></li>
        </ul></div>
    </div>
    
</body>
</html>

结果
在这里插入图片描述

  • 22
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值