限时优惠活动
亲爱的苦力吧用户,我们为了回馈新老用户一直以来的鼎力支持,即日起(2025-02-06至2025-03-06)凡是购买苦力吧VIP/充值K币的新老用户,都直接可获得买一送一的优惠馈赠。例如:购买一个月的VIP会员可直接获得两个月的VIP会员;充值100K币可直接获得200K币,以此类推!有任何疑问可联系在线客服,感谢各位用户对苦力吧素材的信任与厚爱,我们将一如既往的给大家上新更多优质的素材源码,祝大家开工大吉、工作顺利、心想事成。

基于css实现的响应式产品图文信息展示卡片

所属分类: 网页特效-其它&杂项    2023-12-10 11:30:35

基于css实现的响应式产品图文信息展示卡片 ie兼容6
 查看演示  登录后下载 温馨提示
登录会员即可享受免费下载
 我要建站

基于css实现的响应式产品图文信息展示卡片(共4个文件)

    • product.jpg
    • product2.jpg
    • index.html

使用方法

  • code
  • source
  1. body {
  2. background-color: hsl(30, 38%, 92%);
  3. font-family: PingFang SC,Microsoft YaHei,sans-serif;
  4. }
  5. .cd__main{
  6. position: relative;
  7. display: block !important;
  8. min-height: 720px;
  9. background: linear-gradient(to right, #a8ff78, #78ffd6) !important;
  10. }
  11. .container {
  12. position: absolute;
  13. top: 0;
  14. right: 0;
  15. bottom: 0;
  16. left: 0;
  17. margin: auto;
  18. display: grid;
  19. grid-template-columns: 1fr 1fr;
  20. width: 600px;
  21. height: 450px;
  22. background-color: white;
  23. border-radius: 10px;
  24. }
  25. .left-side {
  26. background-image: url(../product.jpg);
  27. background-size: cover;
  28. background-position: center;
  29. border-radius: 10px 0px 0px 10px;
  30. }
  31. .right-side {
  32. margin: 20px 32px 32px 32px;
  33. }
  34. #perfume {
  35. font-size: 12px;
  36. letter-spacing: 5px;
  37. color: hsl(228, 12%, 48%);
  38. }
  39. #header {
  40. font-family: PingFang SC,Microsoft YaHei,sans-serif;
  41. line-height: 1;
  42. color: hsl(212, 21%, 14%);
  43. margin: 25px auto;
  44. }
  45. #description {
  46. font-size: 14px;
  47. color: hsl(228, 12%, 48%);
  48. line-height: 1.8;
  49. margin-bottom: 5px;
  50. margin-top: 20px
  51. }
  52. #number-discount, #number-full {
  53. display: inline-block;
  54. vertical-align: middle;
  55. }
  56. #number-discount {
  57. color: hsl(158, 36%, 37%);
  58. font-family: 'Fraunces', serif;
  59. margin-right: 10px;
  60. }
  61. #number-full {
  62. font-size: 14px;
  63. color: hsl(228, 12%, 48%);
  64. text-decoration: line-through;
  65. }
  66. .cart-btn {
  67. display: flex;
  68. justify-content: center;
  69. align-items: center;
  70. gap: 10px;
  71. width: 100%;
  72. height: 50px;
  73. border-radius: 10px;
  74. border: none;
  75. background-color: hsl(158, 36%, 37%);
  76. color: white;
  77. font-family: 'Montserrat', sans-serif;
  78. font-weight: 700;
  79. transition: background-color 0.2s;
  80. margin-top: 40px
  81. }
  82. .cart-btn:hover {
  83. background-color: hsl(156, 42%, 18%);
  84. cursor: pointer;
  85. }
  86. .cart-btn > svg {
  87. margin-left: -8px;
  88. }
  89. @media only screen and (max-width: 767px) {
  90. .container {
  91. grid-template-columns: 1fr;
  92. width: 345px;
  93. height: 610px;
  94. }
  95. .left-side {
  96. background-image: url(../product2.jpg);
  97. height: 240px;
  98. border-radius: 10px 10px 0 0;
  99. }
  100. #perfume {
  101. margin-top: 5px;
  102. margin-bottom: -10px;
  103. }
  104. #description {
  105. margin-top: -8px;
  106. margin-bottom: -1px;
  107. }
  108. .price {
  109. margin-bottom: -8px;
  110. }
  111. .cart-btn {
  112. height: 48px;
  113. }
  114. }
body {
    background-color: hsl(30, 38%, 92%);
    font-family: PingFang SC,Microsoft YaHei,sans-serif;
}

.cd__main{
   position: relative;
   display: block !important;
   min-height: 720px;
     background: linear-gradient(to right, #a8ff78, #78ffd6) !important;
}
  
.container {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    margin: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 600px;
    height: 450px;
    background-color: white;
    border-radius: 10px;
}

.left-side {
    background-image: url(../product.jpg);
    background-size: cover;
    background-position: center;
    border-radius: 10px 0px 0px 10px;
}

.right-side {
    margin: 20px 32px 32px 32px;
}

#perfume {
    font-size: 12px;
    letter-spacing: 5px;
    color: hsl(228, 12%, 48%);
}

#header {
    font-family: PingFang SC,Microsoft YaHei,sans-serif;
    line-height: 1;
    color: hsl(212, 21%, 14%);
    margin: 25px auto;
}

#description {
    font-size: 14px;
    color: hsl(228, 12%, 48%);
    line-height: 1.8;
    margin-bottom: 5px;
    margin-top: 20px
}


#number-discount, #number-full {
    display: inline-block;
    vertical-align: middle;
}

#number-discount {
    color: hsl(158, 36%, 37%);
    font-family: 'Fraunces', serif;
    margin-right: 10px;
}

#number-full {
    font-size: 14px;
    color: hsl(228, 12%, 48%);
    text-decoration: line-through;
}

.cart-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    border-radius: 10px;
    border: none;
    background-color: hsl(158, 36%, 37%);
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    transition: background-color 0.2s;
    margin-top: 40px
}

.cart-btn:hover {
    background-color: hsl(156, 42%, 18%);
    cursor: pointer;
}

.cart-btn > svg {
    margin-left: -8px;
}

@media only screen and (max-width: 767px) {
    .container {
      grid-template-columns: 1fr;
      width: 345px;
      height: 610px;
    }

    .left-side {
        background-image: url(../product2.jpg);
        height: 240px;
        border-radius: 10px 10px 0 0;
    }

    #perfume {
        margin-top: 5px;
        margin-bottom: -10px;
    }

    #description {
        margin-top: -8px;
        margin-bottom: -1px;
    }

    .price {
        margin-bottom: -8px;
    }

    .cart-btn {
        height: 48px;
    }
  }

站长提示:
1. 苦力吧素材官方QQ群:950875342
2. 平台上所有素材资源,需注册登录会员方能正常下载。
3. 会员用户积极反馈网站、素材资源BUG或错误问题,每次奖励2K币
4. PHP源码类素材,如需协助安装调试,或你有二次开发需求,可联系苦力吧客服。
5. 付费素材资源,需充值后方能下载,如有任何疑问可直接联系苦力吧客服
相关资源 / 其它&杂项

jquery复制文本文字到剪贴板插件

鼠标点击即可复制当前DIV标签内容,移动端也同样兼容,非常实用!
  其它&杂项
 2383  0

jquery多层多区域拖拽插件

一款多层多区域拖拽小插件,可自定义多区域,拖拽图片悬停在某个区域上放手,会自动吸附归位,样式完全自定义。
  其它&杂项
 8388  0

JavaScript本地存储管理购物车功能

一款基于localStorage实现的网站购物车特效,可将商品项目添加到购物车,并可以显示购物车列表数据,带一键清空购物车功能。
  其它&杂项
 8362  0

jquery检测当前用户空闲状态触发事件

一款当前用户空闲检测插件,用于检测用户的页面的行为状态,并在用户空闲一定时间后触发事件。包含:鼠标操作、键盘操作、触摸操作等。
  其它&杂项
 2353  0

评论数(3) 回复有机会获得K币 用户协议

    何处不逢杨0
    2024-01-04 23:32:04
    不错刚好用到哦,感谢苦力吧
    回复 1
    xiaoshenzhen0
    2023-12-15 13:31:49
    这种响应式布局怎么做的,感觉好神奇😕
        jq小菜鸡
        2023-12-18 12:10:00
        根据分辨率来设置最大宽度和最小高度,然后各种百分比设置
    回复 2
😀
  • 😀
  • 😊
  • 😂
  • 😍
  • 😑
  • 😷
  • 😵
  • 😛
  • 😣
  • 😱
  • 😋
  • 😎
  • 😵
  • 😕
  • 😶
  • 😚
  • 😜
  • 😭
发表评论