• 购物车


    html:


           

               

                   
                   
               

               
    商品信息

               
    单价

               
    数量

               
    金额

               
    操作

           

           
           


           


           
       

    css:

    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        user-select: none;
        -moz-user-select: none;
    }

    body {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
        color: #3c3c3c;
    }

    a {
        text-decoration: none;
        color: #3c3c3c;
    }

    a:hover {
        text-decoration: underline;
        color: #f40;
    }

    .clearfix::after {
        content: "";
        clear: both;
        display: block;
        visibility: hidden;
        height: 0;
        font-size: 0;
    }

    .icon {
        background-image: url(imgs/icons.png);
        background-repeat: no-repeat;
    }

    .carts {
        width: 990px;
        margin: 10px auto;
        /* border: 1px solid #3c3c3c; */
    }

    .carts .top {
        height: 50px;
        line-height: 50px;
    }

    .selected, .carts .top .title {
        float: left;
        width: 120px;
        padding-left: 10px;
    }

    .selected {
        width: 85px;
        cursor: pointer;
    }

    .selected .checkbox {
        display: inline-block;
        width: 15px;
        height: 15px;
        line-height: 15px;
        background-position: 0 0;
        position: relative;
        top: 4px;
        cursor: pointer;
    }

    /* i选中的时候的类 修改背景图片的位置 */

    .selected .checkbox.active {
        background-position: 0 -20px;
    }

    .carts .top .product {
        /* cacl() 计算函数 */
        width: calc(100% - 85px - 85px - (120px*3));
    }

    .carts .top .operate {
        width: 85px;
    }

    .carts .top .selected label {
        cursor: pointer;
    }

    .carts input[type='checkbox'] {
        display: none;
    }

    .shop-icon {
        background-position: -20px -105px;
        width: 16px;
        height: 16px;
        display: inline-block;
        /* visibility: hidden */
    }

    .carts .shop_box .shop {
        margin-bottom: 20px;
        /* border: 1px solid #3c3c3c; */
    }

    .carts .shop_box .shop-info {
        height: 40px;
        line-height: 40px;
    }

    .carts .shop_box .shop-info .selected {
        width: 40px;
    }

    .carts .shop_box .shop-info .shop-name .shop-icon {
        display: inline-block;
        width: 16px;
        height: 16px;
        background-position: -20px -105px;
    }

    .carts .shop_box .shop-info .shop-name span {
        margin-left: 15px;
    }

    .shop .shop-item .item {
        background-color: #fff;
        border: 1px solid #3c3c3c;
        padding: 20px 0;
    }

    .shop .shop-item .item>div {
        float: left;
        width: 120px;
        padding-left: 10px;
    }

    .shop .shop-item .item .selected {
        width: 30px;
    }

    .shop .shop-item .item .operator {
        width: 85px;
    }

    .shop .shop-item .item .product {
        width: calc(100% - 30px - 85px - (120px*3) - 150px);
    }

    .shop .shop-item .item .product .img {
        float: left;
    }

    .shop .shop-item .item .product .img img {
        width: 80px;
        height: 80px;
    }

    .shop .shop-item .item .product .info {
        /* float: right; */
        width: 260px;
        padding-left: 100px;
    }

    .shop .shop-item .item .product .info>div {
        margin-bottom: 5px;
    }

    .shop .shop-item .item .spec {
        color: #d3cece;
        width: 150px;
    }

    .shop .shop-item .item .count {
        font-size: 0;
        color: #444;
    }

    .shop .shop-item .item .count span {
        font-size: 12px;
        color: #444;
        text-align: center;
        /* float: left; */
        /* margin-right: 5px; */
        background-color: lightslategray;
        width: 20px;
        display: inline-block;
        line-height: 20px;
    }

    .shop .shop-item .item .count span:nth-child(2) {
        display: inline-block;
        width: 50px;
        background-color: transparent;
        position: relative;
        top: 1px;
    }

    .shop .shop-item .item .count span input {
        text-align: center;
        width: 50px;
    }

    .shop .shop-item .item .amount {
        color: red;
    }

    .shop_footer {
        height: 50px;
        background-color: lightslategray;
        padding: 20px;
    }

    .shop_footer .selected, .links {
        float: left;
    }

    .shop_footer .sum {
        float: right;
        position: relative;
        top: -20px;
    }

    .shop_footer .sum span {
        margin-right: 2px;
    }

    .shop_footer .sum span:last-child {
        background-color: #f40;
        width: 50px;
        /* height: 50px; */
        display: inline-block;
        text-align: center;
        line-height: 50px;

    }

    js:


         

     

  • 相关阅读:
    oracle中使用rownum作为条件的失效问题的原因和解决方法
    基于单片机GPS轨迹定位和里程统计系统
    【STL】容器 - string的模拟实现
    R语言计算两个向量成对元素的最小值:计算两个向量的平行最小值(parallel minimum)
    [Lecture_Review] [VALSE]薪火相传经验谈——学长学姐教你如何做科研
    深度学习算法
    分享那些让你苦笑不得的Bug经历
    MySQL的增删改查2
    Python中Numpy的应用技巧
    臻图信息基于GIS可视化构建智慧消防平台,全面保障城市安全运营
  • 原文地址:https://blog.csdn.net/weixin_55711841/article/details/126002915