关于火狐和谷歌浏览器中的图片九宫格布局
2016-07-21 14:39
357 查看
由于谷歌浏览器和火狐浏览器对padding和margin的解析标准不一样,所以正常布局会出现火狐浏览器没有上下距离,但是谷歌是正常的,解决代码如下:
html:
<div class="center">
<span>我们积累了各行业丰富的案例和经验</span>
<div class="centerSiximg">
<a href="licai.html"><img src="img/example1.png" /></a>
<a href="jianxin.html"><img src="img/example2.png" /></a>
<a href="kaicaibao.html"><img src="img/example3.png" /></a>
<a href="taqu.html"><img src="img/example4.png" /></a>
<a href="kuailegou.html"><img src="img/example5.png" /></a>
<a href="h5.html"><img src="img/example6.png" /></a>
</div>
</div>
css:
.centerSiximg{
width: 62%;
text-align: center;
margin: 0 auto;
display: -moz-box;
display: -webkit-box;
-moz-box-orient: horizontal;
-webkit-box-orient: horizontal;
display: flex;
flex-flow: row wrap;
padding-bottom: 8%;
}
.centerSiximg a{
width:31%;
height: 100%;
margin-left: 2%;
}
.centerSiximg a img{
display: block;
width: 100%;
height: 100%;
margin-top: 6%;
}
效果图:
html:
<div class="center">
<span>我们积累了各行业丰富的案例和经验</span>
<div class="centerSiximg">
<a href="licai.html"><img src="img/example1.png" /></a>
<a href="jianxin.html"><img src="img/example2.png" /></a>
<a href="kaicaibao.html"><img src="img/example3.png" /></a>
<a href="taqu.html"><img src="img/example4.png" /></a>
<a href="kuailegou.html"><img src="img/example5.png" /></a>
<a href="h5.html"><img src="img/example6.png" /></a>
</div>
</div>
css:
.centerSiximg{
width: 62%;
text-align: center;
margin: 0 auto;
display: -moz-box;
display: -webkit-box;
-moz-box-orient: horizontal;
-webkit-box-orient: horizontal;
display: flex;
flex-flow: row wrap;
padding-bottom: 8%;
}
.centerSiximg a{
width:31%;
height: 100%;
margin-left: 2%;
}
.centerSiximg a img{
display: block;
width: 100%;
height: 100%;
margin-top: 6%;
}
效果图:
相关文章推荐
- ReactNative学习笔记-Native主动发送消息给JS
- Vector、ArrayList、LinkList、Set梳理
- 最强理解:Android对EditText输入时设置监听即TextWatcher的用法
- hadoop lzo的使用方法
- 互联网时代: 从Uber的供需匹配看开发需求
- 关于react-native navigator 记录
- mysql集群一:主从复制,通过mysql-proxy做负载均衡
- 父元素与子元素margin-top问题
- 响应式布局----像素密度与viewport
- 事件拦截机制分析(Android群英传)
- 开源好项目
- SpringMVC中向服务器传递时间参数时出现的问题
- android中ExpandableListView的使用
- 使用erlang 的公司/产品
- TextView在设置高度比较小的时候,字体太大会导致文字看起来不居中,要么改高度要么改字体大小
- Android应用界面开发05
- Fragment点击按钮替换界面防止重新实例化,使用hide和add
- poj 2398
- freemarker初识
- CodeForces 1A Theatre Square