美文网首页
中分两列商品列表展示

中分两列商品列表展示

作者: 有备而来的王 | 来源:发表于2019-02-21 14:17 被阅读0次

效果图


image.png

1.html

<div class="sanp_content">
            <div class="p-2-1">
                <div class="sanp_son">
                    <img src="img/luyou.jpg"/>
                    <div class="sanp_name">
                        双频USB无线网卡台式机笔记本通用 随身WiFi接收器
                    </div>
                    <div style="height: 30px;">
                        <span class="sanp_price">¥78</span>
                        <span class="sanp_p_price">¥124</span>                      
                    </div>
                </div>  
            </div>
            <div class="p-2-1">
                <div class="sanp_son">
                    <img src="img/luyou.jpg"/>
                    <div class="sanp_name">
                        双频USB无线网卡台式机笔记本通用 随身WiFi接收器
                    </div>
                    <div style="height: 30px;">
                        <span class="sanp_price">¥78</span>
                        <span class="sanp_p_price">¥124</span>                      
                    </div>
                </div>  
            </div>
            <div class="p-2-1">
                <div class="sanp_son">
                    <img src="img/luyou.jpg"/>
                    <div class="sanp_name">
                        双频USB无线网卡台式机笔记本通用 随身WiFi接收器
                    </div>
                    <div style="height: 30px;">
                        <span class="sanp_price">¥78</span>
                        <span class="sanp_p_price">¥124</span>                      
                    </div>
                </div>  
            </div>
            <div class="p-2-1">
                <div class="sanp_son">
                    <img src="img/luyou.jpg"/>
                    <div class="sanp_name">
                        双频USB无线网卡台式机笔记本通用 随身WiFi接收器
                    </div>
                    <div style="height: 30px;">
                        <span class="sanp_price">¥78</span>
                        <span class="sanp_p_price">¥124</span>                      
                    </div>
                </div>  
            </div>
        </div>

2.css

.sanp_content{
    width: 100%;
    display: flex;
    flex-wrap: wrap;
}
.p-2-1{
    width: 50%;
}
.p-2-1:nth-child(2n+1)>.sanp_son{
    margin: 8px 4px 0 0;
    padding-left: 10px;
    position: relative;
}
.p-2-1:nth-child(2n)>.sanp_son{
    margin: 8px 0 0 4px;
    padding-right: 10px;
    position: relative;
}
.p-2-1:nth-child(2)>.sanp_son{
    margin-top: 0;
    position: relative;
}
.p-2-1:first-child>.sanp_son{
    margin-top: 0;
    position: relative;
}
.sanp_name{
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    padding-left: 3px;
    height: 30px;
    line-height: 30px;
}
.sanp_son img{
    width: 100%;
    height: 110px;
    align-content: center;
}
.sanp_price{
    font-size: 14px;
    color: red;
    float: left;
    height: 30px;
    line-height: 30px;
    margin-left: 3px;
}
.sanp_p_price{
    font-size: 12px;
    color: #C4C4C4;
    text-decoration: line-through;
    float: left;
    height: 30px;
    line-height: 30px;
    margin-left: 10px;
}

相关文章

  • 中分两列商品列表展示

    效果图 1.html 2.css

  • Express+Jquery实现购物车的前后端

    需求分析: 列表页list.html html结构 列表页功能一: 初始化展示商品列表 前端代码 后端代码 列...

  • Flutter-GridView组件

    GridView用于展示多列的展示,在开发中也非常常见,比如直播App中的主播列表、电商中的商品列表等等。 1. ...

  • 21.GridView组件

    GridView用于展示多列的展示,在开发中也非常常见,比如直播App中的主播列表、电商中的商品列表等等。 在Fl...

  • ionic3项目实战教程 - 第7讲 ionic3商品列表页的实

    这一讲主要包含以下几个部分: 1.创建商品列表页 2.根据分类获取商品列表 2.展示商品列表 1.创建商品列表页 ...

  • js防抖和节流

    web开发中经常会做滚动监听,比如商品分类功能:左右两列,左侧类目,右侧商品,需要监听右测商品列表的滚动,滚到哪个...

  • 关于无货bug

    问题描述,列表不向用户展示是否有货,进入商品详情展示商品是否有货,当无货商品较多时,会影响用户体验。 原因:测试跟...

  • 2019-10-31

    企业包不支持内购✨✨✨✨✨ iTunes Store 购买商品 使用StoreKit库 商品模型: 商品列表展示步...

  • CSS图片缩放模糊问题

    在网站中,我们常常需要展示图片,如:商品列表、项目列表、轮播图、banner等。这些图片有的来源有两种: 用户自己...

  • 商城APP开发如何优化购物车环节

    商城APP开发的购物流程主要步骤: 第一步:商品资源信息展示,包括活动页面商品展示、列表页、搜索框、店铺/商品收藏...

网友评论

      本文标题:中分两列商品列表展示

      本文链接:https://www.haomeiwen.com/subject/qvmryqtx.html