缩略图展示商品信息
2016-09-07 17:59
155 查看
今天要切一个页面,美工要求右侧图片要与右边线对齐,由于给缩略图设置了margin-right属性,导致图片与右边线有一个margin-right的距离,但是查看了tmall 和 jd 两家网站,都是右边线对齐的,这样显得好看多了。
问题:
容器的宽度是1200px,每个item的样式是一致的,开发只是做了重复遍历item的操作,中间的间隔只有4段,但是内容有5个,就会导致最后一个在容器中装不下,会出现换行。
解决办法:
1、将一个子item的宽度设置为232px,然后设置其margin-right为10px;(10*4 + 232*5 = 1200)
2、将list容器设置为1250px(只需要大于1210px小于1210+232+10px即可),这样就会在第6个的时候因为剩余空间装不下而换行。
大小: 161 KB
查看图片附件
问题:
容器的宽度是1200px,每个item的样式是一致的,开发只是做了重复遍历item的操作,中间的间隔只有4段,但是内容有5个,就会导致最后一个在容器中装不下,会出现换行。
解决办法:
1、将一个子item的宽度设置为232px,然后设置其margin-right为10px;(10*4 + 232*5 = 1200)
2、将list容器设置为1250px(只需要大于1210px小于1210+232+10px即可),这样就会在第6个的时候因为剩余空间装不下而换行。
<style> .list_width { cursor: pointer; overflow: visible; width: 232px; } .float_left { float: left; } .border_b_eee { border: 1px solid #eeeeee; } .sqh_relative { position: relative; } .margin_right_10 { margin-right: 10px; } .margin_bottom_10 { margin-bottom: 10px; } </style> <div class="margin_bottom_20" style="width: 1250px;"> <div class="float_left margin_bottom_10 sqh_relative margin_right_10 border_b_eee list_width" onclick="jumpTo(this)" target="http://www.baidu.com"> <div class=""> <img src="img/huijishi_list/mangguo.png" class="img-responsive" style="width:230px;height:230px;" > </div> <div class="margin_top_10 margin_left_10 margin_right_10"> <span class="sqh_font_color_red font_16">¥59.90</span> <del class="font_12 sqh_color_99">25.60元</del> <button type="button" class="btn btn_nobg_yellowborder float_right" style="padding: 0px 5px;">天天半价</button> </div> <div class="margin_left_10 margin_right_10 summary margin_bottom_5"> 泰国进口大金煌芒果5斤 泰芒鲜水果 约3-5个装 </div> </div> ... ... </div>
大小: 161 KB
查看图片附件
相关文章推荐
- HTML5 CSS3 专题 :诱人的实例 3D展示商品信息
- HTML5 CSS3 专题 :诱人的实例 3D展示商品信息
- 【javaweb:jsp】从服务器获取动态商品信息并展示在jsp中
- HTML5 CSS3 专题 :诱人的实例 3D展示商品信息
- HTML5 CSS3 专题 :诱人的实例 3D展示商品信息
- 案例 商品展示
- shu数据库操作——商品展示
- 电池信息变化统计与展示
- java redis多线程爬取国美商品信息
- Android数据 存储和访问——商品展示
- 获取视频和图片缩略图 与媒体信息
- 商品展示案例
- 使用HashSet和TreeSet存储多个商品信息,遍历并输出;其中商品属性:编号,名称,单价,出版社;要求向其中添加多个相同的商品,验证集合中元素的唯一性。 提示:向HashSet中添加自定义
- 商品展示案例
- ListView展示网络服务信息 (SIM信息的扩展)!
- Bootstrap3生成响应式的特价商品展示布局
- 产品分类页面得到当前分类ID,产品详细信息页面得到当前产品默认商店的的商品名称 ---NAME
- 内容和电商类APP,都有哪些常见的信息展示方式?
- thinkphp上传goods表信息+上传图片+缩略图转换
- 用ASP.NET上传图片并生成可带版权信息的缩略图