HTML+CSS简单实现小米商城

前端初学者,有啥不足的还请指出。

代码如下

<!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>小米商城</title>
    <link rel="icon" href="images/logo.ico" type="images/x-icon">
    
        <link rel="stylesheet" href="css/style.css">
    
</head>
<body>
    <div class="box">
        <div class="left">
            <img src="./images/左边.webp" alt="">
        </div>
        <div class="right">
            <ol>
            <a href="#">
                <li>
                    <img src="./images/1.webp" alt="">
                    <h3 class="title">Redmi K50 Pro</h3>
                    <p class="desc">2K直屏的狠旗舰</p>
                    <p class="price">2999元起</p>
                </li>
            </a>
            <a href="#">
                <li>
                    <img src="./images/2.webp" alt="">
                    <h3 class="title">Redmi K50</h3>
                    <p class="desc">2K直屏的狠旗舰</p>
                    <p class="price">2399元起</p>
                </li>
            </a>
            <a href="#">
                <li>
                    <img src="./images/3.webp" alt="">
                    <h3 class="title">Redmi K40S</h3>
                    <p class="desc">口碑真旗舰</p>
                    <p class="price">1799元起</p>
                </li>
            </a>
            <a href="#">
                <li>
                    <img src="./images/4.webp" alt="">
                    <h3 class="title">Redmi K50 电竞版</h3>
                    <p class="desc">全线拉满的冷血旗舰</p>
                    <p class="price">3299元起</p>
                </li>
            </a>
            <a href="#">
                <li>
                    <img src="./images/5.webp" alt="">
                    <h3 class="title">Xiaomi 12 Pro</h3>
                    <p class="desc">全新骁龙8|2K AMOLED屏幕</p>
                    <p class="price">4699元起</p>
                </li>
            </a>
            <a href="#">
                <li>
                    <img src="./images/6.webp" alt="">
                    <h3 class="title">Xiaomi 12</h3>
                    <p class="desc">全新骁龙8|5000万主摄</p>
                    <p class="price">3699元起</p>
                </li>
            </a>
            <a href="#">
                <li>
                    <img src="/mi/images/7.webp" alt="">
                    <h3 class="title">Xiaomi 12X</h3>
                    <p class="desc">骁龙870|5000万主摄</p>
                    <p class="price">2999元起</p>
                </li>
            </a>
            <a href="#">
                <li>
                    <img src="/mi/images/8.webp" alt="">
                    <h3 class="title">Xiaomi 11 青春活力版</h3>
                    <p class="desc">轻薄5G,内外皆出彩</p>
                    <p class="price">
                        <span class="num">1899</span>元<span>起&nbsp</span>
                        <del><span class="num">1999</span>元</del>
                    </p>
                </li>
            </a>
            </ol>
        </div>
    </div>
</body>
</html>
* {
    padding: 0;
    margin: 0;
}
ol{
    list-style: none;
}
body{
    background-color: #F5F5F5;
}
body .box{
    width: 1226px;
    height: 614px;
    margin: 50px auto;
}
body .box .left{
    width: 234px;
    height: 614px;
    float: left;
}
body .box .right{
    width: 992px;
    height: 614px;
    float: left;
    
}
body .box .right ol li{
    width: 234px;
    height: 260px;
    background-color: white;
    float: left;
    margin-left: 14px;
    margin-bottom: 14px;
    padding: 20px 0px;
}
.box .left img{
    width: 234px;
    height: 614px;
}
img{
    width: 160px;
    height: 160px;
    margin-bottom: 15px;
}
.box .right ol li{
    text-align: center;
}
.right ol li .title{
    display: block;
    margin: 0px 10px 2px;
    font-size: 14px;
    font-weight: 400;
    color: #333;
}
.right ol li .desc{
    display: block;
    margin: 0px 10px 10px;
    height: 18px;
    font-weight: 400;
    font-size: 12px;
    color: #b0b0b0;
}
.right ol li .price{
    display: block;
    margin: 0px 10px 14px;
    color: #ff6700;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
}
.right ol li .price del{
    color: #b0b0b0;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
}
.right ol a:hover{
    box-shadow: 10px 10px 20px rgba(119, 117, 117, 0.3) ; 
    
}

  • 16
    点赞
  • 92
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

该编程了

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值