前端学习之用css和html做一个仿淘宝的导航栏

代码

html 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>仿淘宝界面案例</title>
    <style>
        /* 最外层盒子 */
        .container{
            width: 270px;
            height: 385px;
            border: 1px solid rgb(255, 208, 0);
            border-radius: 20px;
            float: left;
            margin: 10px;

        }
        /* 商品图片 */
        img{
            width: 265px;
            height: 265px;
            margin: 2px;
            border-radius: 20px;
        }
        /* 商品名字 */
        .a{
            width: 270px;
            height: 130px;
            
        }
        /* 商品价格 */
        .c{
            color: #fd3f31;
            font-size: 20px;

        }
        /* 店铺图标 */
        .d{ 
            width: 14px;
            height: 14px;
            vertical-align: text-bottom;
        }
        /* 店铺名字 */
        .e{
            font-size: 14px;
           vertical-align: text-bottom;
            
        }
        /* 月销量 */
        .f{
            text-align: right;
        }
    </style>
</head>
<body>
    <div class="container">
        <img src="https://img.alicdn.com/img/i1/5464898968/O1CN01w2Ax4n2G7OqzBRsa4_!!0-saturn_solar.jpg_360x360xzq75.jpg_.webp" alt="">
        <div class="a"><span class="b">全自动发牌机扑克机德州掼蛋炸金花斗地主惯蛋洗牌发牌一体机</span>
        <div class="c">¥538</div>
        <span><img class="d" src="https://ts1.cn.mm.bing.net/th/id/R-C.cd7f2177c5f972704797a40909d7323e?rik=SFRNEwcJI2GM9Q&riu=http%3a%2f%2fbpic.588ku.com%2felement_pic%2f19%2f04%2f11%2fc9e6390833bec20f2a7487ab9d3e7e85.jpg&ehk=RQbdmstklcc7q%2bejIcH6RfnOut%2fAtyHASG3dt0sDKig%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1" alt=""> </span>
        <span class="e">某某发牌机工厂店</span>
        
        <div class="f"><span class="g">月销 0 &nbsp;</span></div>
        </div>
    </div>
    <div class="container">
        <img src="https://img.alicdn.com/img/i1/5464898968/O1CN01w2Ax4n2G7OqzBRsa4_!!0-saturn_solar.jpg_360x360xzq75.jpg_.webp" alt="">
        <div class="a"><span class="b">全自动发牌机扑克机德州掼蛋炸金花斗地主惯蛋洗牌发牌一体机</span>
        <div class="c">¥538</div>
        <span><img class="d" src="https://ts1.cn.mm.bing.net/th/id/R-C.cd7f2177c5f972704797a40909d7323e?rik=SFRNEwcJI2GM9Q&riu=http%3a%2f%2fbpic.588ku.com%2felement_pic%2f19%2f04%2f11%2fc9e6390833bec20f2a7487ab9d3e7e85.jpg&ehk=RQbdmstklcc7q%2bejIcH6RfnOut%2fAtyHASG3dt0sDKig%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1" alt=""> </span>
        <span class="e">某某发牌机工厂店</span>
        
        <div class="f"><span class="g">月销 0 &nbsp;</span></div>
        </div>
    </div>    <div class="container">
        <img src="https://img.alicdn.com/img/i1/5464898968/O1CN01w2Ax4n2G7OqzBRsa4_!!0-saturn_solar.jpg_360x360xzq75.jpg_.webp" alt="">
        <div class="a"><span class="b">全自动发牌机扑克机德州掼蛋炸金花斗地主惯蛋洗牌发牌一体机</span>
        <div class="c">¥538</div>
        <span><img class="d" src="https://ts1.cn.mm.bing.net/th/id/R-C.cd7f2177c5f972704797a40909d7323e?rik=SFRNEwcJI2GM9Q&riu=http%3a%2f%2fbpic.588ku.com%2felement_pic%2f19%2f04%2f11%2fc9e6390833bec20f2a7487ab9d3e7e85.jpg&ehk=RQbdmstklcc7q%2bejIcH6RfnOut%2fAtyHASG3dt0sDKig%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1" alt=""> </span>
        <span class="e">某某发牌机工厂店</span>
        
        <div class="f"><span class="g">月销 0 &nbsp;</span></div>
        </div>
    </div>    <div class="container">
        <img src="https://img.alicdn.com/img/i1/5464898968/O1CN01w2Ax4n2G7OqzBRsa4_!!0-saturn_solar.jpg_360x360xzq75.jpg_.webp" alt="">
        <div class="a"><span class="b">全自动发牌机扑克机德州掼蛋炸金花斗地主惯蛋洗牌发牌一体机</span>
        <div class="c">¥538</div>
        <span><img class="d" src="https://ts1.cn.mm.bing.net/th/id/R-C.cd7f2177c5f972704797a40909d7323e?rik=SFRNEwcJI2GM9Q&riu=http%3a%2f%2fbpic.588ku.com%2felement_pic%2f19%2f04%2f11%2fc9e6390833bec20f2a7487ab9d3e7e85.jpg&ehk=RQbdmstklcc7q%2bejIcH6RfnOut%2fAtyHASG3dt0sDKig%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1" alt=""> </span>
        <span class="e">某某发牌机工厂店</span>
        
        <div class="f"><span class="g">月销 0 &nbsp;</span></div>
        </div>
    </div>    
    <div class="container">
        <img src="https://img.alicdn.com/img/i1/5464898968/O1CN01w2Ax4n2G7OqzBRsa4_!!0-saturn_solar.jpg_360x360xzq75.jpg_.webp" alt="">
        <div class="a"><span class="b">全自动发牌机扑克机德州掼蛋炸金花斗地主惯蛋洗牌发牌一体机</span>
        <div class="c">¥538</div>
        <span><img class="d" src="https://ts1.cn.mm.bing.net/th/id/R-C.cd7f2177c5f972704797a40909d7323e?rik=SFRNEwcJI2GM9Q&riu=http%3a%2f%2fbpic.588ku.com%2felement_pic%2f19%2f04%2f11%2fc9e6390833bec20f2a7487ab9d3e7e85.jpg&ehk=RQbdmstklcc7q%2bejIcH6RfnOut%2fAtyHASG3dt0sDKig%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1" alt=""> </span>
        <span class="e">某某发牌机工厂店</span>
        
        <div class="f"><span class="g">月销 0 &nbsp;</span></div>
        </div>
    </div>
    <div class="container">
        <img src="https://img.alicdn.com/img/i1/5464898968/O1CN01w2Ax4n2G7OqzBRsa4_!!0-saturn_solar.jpg_360x360xzq75.jpg_.webp" alt="">
        <div class="a"><span class="b">全自动发牌机扑克机德州掼蛋炸金花斗地主惯蛋洗牌发牌一体机</span>
        <div class="c">¥538</div>
        <span><img class="d" src="https://ts1.cn.mm.bing.net/th/id/R-C.cd7f2177c5f972704797a40909d7323e?rik=SFRNEwcJI2GM9Q&riu=http%3a%2f%2fbpic.588ku.com%2felement_pic%2f19%2f04%2f11%2fc9e6390833bec20f2a7487ab9d3e7e85.jpg&ehk=RQbdmstklcc7q%2bejIcH6RfnOut%2fAtyHASG3dt0sDKig%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1" alt=""> </span>
        <span class="e">某某发牌机工厂店</span>
        
        <div class="f"><span class="g">月销 0 &nbsp;</span></div>
        </div>
    </div>
    <div class="container">
        <img src="https://img.alicdn.com/img/i1/5464898968/O1CN01w2Ax4n2G7OqzBRsa4_!!0-saturn_solar.jpg_360x360xzq75.jpg_.webp" alt="">
        <div class="a"><span class="b">全自动发牌机扑克机德州掼蛋炸金花斗地主惯蛋洗牌发牌一体机</span>
        <div class="c">¥538</div>
        <span><img class="d" src="https://ts1.cn.mm.bing.net/th/id/R-C.cd7f2177c5f972704797a40909d7323e?rik=SFRNEwcJI2GM9Q&riu=http%3a%2f%2fbpic.588ku.com%2felement_pic%2f19%2f04%2f11%2fc9e6390833bec20f2a7487ab9d3e7e85.jpg&ehk=RQbdmstklcc7q%2bejIcH6RfnOut%2fAtyHASG3dt0sDKig%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1" alt=""> </span>
        <span class="e">某某发牌机工厂店</span>
        
        <div class="f"><span class="g">月销 0 &nbsp;</span></div>
        </div>
    </div>
    <div class="container">
        <img src="https://img.alicdn.com/img/i1/5464898968/O1CN01w2Ax4n2G7OqzBRsa4_!!0-saturn_solar.jpg_360x360xzq75.jpg_.webp" alt="">
        <div class="a"><span class="b">全自动发牌机扑克机德州掼蛋炸金花斗地主惯蛋洗牌发牌一体机</span>
        <div class="c">¥538</div>
        <span><img class="d" src="https://ts1.cn.mm.bing.net/th/id/R-C.cd7f2177c5f972704797a40909d7323e?rik=SFRNEwcJI2GM9Q&riu=http%3a%2f%2fbpic.588ku.com%2felement_pic%2f19%2f04%2f11%2fc9e6390833bec20f2a7487ab9d3e7e85.jpg&ehk=RQbdmstklcc7q%2bejIcH6RfnOut%2fAtyHASG3dt0sDKig%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1" alt=""> </span>
        <span class="e">某某发牌机工厂店</span>
        
        <div class="f"><span class="g">月销 0 &nbsp;</span></div>
        </div>
    </div>
    <div class="container">
        <img src="https://img.alicdn.com/img/i1/5464898968/O1CN01w2Ax4n2G7OqzBRsa4_!!0-saturn_solar.jpg_360x360xzq75.jpg_.webp" alt="">
        <div class="a"><span class="b">全自动发牌机扑克机德州掼蛋炸金花斗地主惯蛋洗牌发牌一体机</span>
        <div class="c">¥538</div>
        <span><img class="d" src="https://ts1.cn.mm.bing.net/th/id/R-C.cd7f2177c5f972704797a40909d7323e?rik=SFRNEwcJI2GM9Q&riu=http%3a%2f%2fbpic.588ku.com%2felement_pic%2f19%2f04%2f11%2fc9e6390833bec20f2a7487ab9d3e7e85.jpg&ehk=RQbdmstklcc7q%2bejIcH6RfnOut%2fAtyHASG3dt0sDKig%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1" alt=""> </span>
        <span class="e">某某发牌机工厂店</span>
        
        <div class="f"><span class="g">月销 0 &nbsp;</span></div>
        </div>
    </div>
    <div class="container">
        <img src="https://img.alicdn.com/img/i1/5464898968/O1CN01w2Ax4n2G7OqzBRsa4_!!0-saturn_solar.jpg_360x360xzq75.jpg_.webp" alt="">
        <div class="a"><span class="b">全自动发牌机扑克机德州掼蛋炸金花斗地主惯蛋洗牌发牌一体机</span>
        <div class="c">¥538</div>
        <span><img class="d" src="https://ts1.cn.mm.bing.net/th/id/R-C.cd7f2177c5f972704797a40909d7323e?rik=SFRNEwcJI2GM9Q&riu=http%3a%2f%2fbpic.588ku.com%2felement_pic%2f19%2f04%2f11%2fc9e6390833bec20f2a7487ab9d3e7e85.jpg&ehk=RQbdmstklcc7q%2bejIcH6RfnOut%2fAtyHASG3dt0sDKig%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1" alt=""> </span>
        <span class="e">某某发牌机工厂店</span>
        
        <div class="f"><span class="g">月销 0 &nbsp;</span></div>
        </div>
    </div>
    <div class="container">
        <img src="https://img.alicdn.com/img/i1/5464898968/O1CN01w2Ax4n2G7OqzBRsa4_!!0-saturn_solar.jpg_360x360xzq75.jpg_.webp" alt="">
        <div class="a"><span class="b">全自动发牌机扑克机德州掼蛋炸金花斗地主惯蛋洗牌发牌一体机</span>
        <div class="c">¥538</div>
        <span><img class="d" src="https://ts1.cn.mm.bing.net/th/id/R-C.cd7f2177c5f972704797a40909d7323e?rik=SFRNEwcJI2GM9Q&riu=http%3a%2f%2fbpic.588ku.com%2felement_pic%2f19%2f04%2f11%2fc9e6390833bec20f2a7487ab9d3e7e85.jpg&ehk=RQbdmstklcc7q%2bejIcH6RfnOut%2fAtyHASG3dt0sDKig%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1" alt=""> </span>
        <span class="e">某某发牌机工厂店</span>
        
        <div class="f"><span class="g">月销 0 &nbsp;</span></div>
        </div>
    </div>
    <div class="container">
        <img src="https://img.alicdn.com/img/i1/5464898968/O1CN01w2Ax4n2G7OqzBRsa4_!!0-saturn_solar.jpg_360x360xzq75.jpg_.webp" alt="">
        <div class="a"><span class="b">全自动发牌机扑克机德州掼蛋炸金花斗地主惯蛋洗牌发牌一体机</span>
        <div class="c">¥538</div>
        <span><img class="d" src="https://ts1.cn.mm.bing.net/th/id/R-C.cd7f2177c5f972704797a40909d7323e?rik=SFRNEwcJI2GM9Q&riu=http%3a%2f%2fbpic.588ku.com%2felement_pic%2f19%2f04%2f11%2fc9e6390833bec20f2a7487ab9d3e7e85.jpg&ehk=RQbdmstklcc7q%2bejIcH6RfnOut%2fAtyHASG3dt0sDKig%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1" alt=""> </span>
        <span class="e">某某发牌机工厂店</span>
        
        <div class="f"><span class="g">月销 0 &nbsp;</span></div>
        </div>
    </div>
    <div class="container">
        <img src="https://img.alicdn.com/img/i1/5464898968/O1CN01w2Ax4n2G7OqzBRsa4_!!0-saturn_solar.jpg_360x360xzq75.jpg_.webp" alt="">
        <div class="a"><span class="b">全自动发牌机扑克机德州掼蛋炸金花斗地主惯蛋洗牌发牌一体机</span>
        <div class="c">¥538</div>
        <span><img class="d" src="https://ts1.cn.mm.bing.net/th/id/R-C.cd7f2177c5f972704797a40909d7323e?rik=SFRNEwcJI2GM9Q&riu=http%3a%2f%2fbpic.588ku.com%2felement_pic%2f19%2f04%2f11%2fc9e6390833bec20f2a7487ab9d3e7e85.jpg&ehk=RQbdmstklcc7q%2bejIcH6RfnOut%2fAtyHASG3dt0sDKig%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1" alt=""> </span>
        <span class="e">某某发牌机工厂店</span>
        
        <div class="f"><span class="g">月销 0 &nbsp;</span></div>
        </div>
    </div>
    <div class="container">
        <img src="https://img.alicdn.com/img/i1/5464898968/O1CN01w2Ax4n2G7OqzBRsa4_!!0-saturn_solar.jpg_360x360xzq75.jpg_.webp" alt="">
        <div class="a"><span class="b">全自动发牌机扑克机德州掼蛋炸金花斗地主惯蛋洗牌发牌一体机</span>
        <div class="c">¥538</div>
        <span><img class="d" src="https://ts1.cn.mm.bing.net/th/id/R-C.cd7f2177c5f972704797a40909d7323e?rik=SFRNEwcJI2GM9Q&riu=http%3a%2f%2fbpic.588ku.com%2felement_pic%2f19%2f04%2f11%2fc9e6390833bec20f2a7487ab9d3e7e85.jpg&ehk=RQbdmstklcc7q%2bejIcH6RfnOut%2fAtyHASG3dt0sDKig%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1" alt=""> </span>
        <span class="e">某某发牌机工厂店</span>
        
        <div class="f"><span class="g">月销 0 &nbsp;</span></div>
        </div>
    </div>
    <div class="container">
        <img src="https://img.alicdn.com/img/i1/5464898968/O1CN01w2Ax4n2G7OqzBRsa4_!!0-saturn_solar.jpg_360x360xzq75.jpg_.webp" alt="">
        <div class="a"><span class="b">全自动发牌机扑克机德州掼蛋炸金花斗地主惯蛋洗牌发牌一体机</span>
        <div class="c">¥538</div>
        <span><img class="d" src="https://ts1.cn.mm.bing.net/th/id/R-C.cd7f2177c5f972704797a40909d7323e?rik=SFRNEwcJI2GM9Q&riu=http%3a%2f%2fbpic.588ku.com%2felement_pic%2f19%2f04%2f11%2fc9e6390833bec20f2a7487ab9d3e7e85.jpg&ehk=RQbdmstklcc7q%2bejIcH6RfnOut%2fAtyHASG3dt0sDKig%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1" alt=""> </span>
        <span class="e">某某发牌机工厂店</span>
        
        <div class="f"><span class="g">月销 0 &nbsp;</span></div>
        </div>
    </div>
    <div class="container">
        <img src="https://img.alicdn.com/img/i1/5464898968/O1CN01w2Ax4n2G7OqzBRsa4_!!0-saturn_solar.jpg_360x360xzq75.jpg_.webp" alt="">
        <div class="a"><span class="b">全自动发牌机扑克机德州掼蛋炸金花斗地主惯蛋洗牌发牌一体机</span>
        <div class="c">¥538</div>
        <span><img class="d" src="https://ts1.cn.mm.bing.net/th/id/R-C.cd7f2177c5f972704797a40909d7323e?rik=SFRNEwcJI2GM9Q&riu=http%3a%2f%2fbpic.588ku.com%2felement_pic%2f19%2f04%2f11%2fc9e6390833bec20f2a7487ab9d3e7e85.jpg&ehk=RQbdmstklcc7q%2bejIcH6RfnOut%2fAtyHASG3dt0sDKig%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1" alt=""> </span>
        <span class="e">某某发牌机工厂店</span>
        
        <div class="f"><span class="g">月销 0 &nbsp;</span></div>
        </div>
    </div>
</body>
</html> 

结果


不嫌弃的点点关注,点点赞 ଘ(੭ˊᵕˋ)੭* ੈ✩‧₊˚

相关推荐
XR-AI-JK39 分钟前
UE5肉鸽游戏教程学习
学习·游戏·ue5·ue4·新手学习·游戏教程·ue教程
咔叽布吉1 小时前
【前端学习笔记】ES6 新特性
前端·笔记·学习
超越✔1 小时前
学习内容分享
笔记·学习·面试
Lostgreen1 小时前
SQL on Hadoop
数据库·hadoop·笔记·分布式·sql·学习
推开世界的门2 小时前
web 中 canvas 污染 以及解决方案
前端
星离~2 小时前
css—轮播图实现
前端·css
八年。。2 小时前
MATLAB 中有关figure图表绘制函数设计(论文中常用)
开发语言·笔记·学习·matlab
龙雨LongYu122 小时前
vue3+ts 我写了一个跟swagger.yml生成请求和响应实体(接口)
前端·vue.js·typescript
lx学习2 小时前
Python学习34天
开发语言·python·学习