IE中img标签多出5px的空白之4种解决方法
2014-11-22 08:19
381 查看
今天我们在网页布局的时候,会发现IE中img样式会多出5px的空白,那怎么办呢?下面给出4中解决办法:
包含img标签的任意源代码片段
代码编辑器
解决方法1:
设置 img 的 vertical-align: bottom;
ul{ width: 280px; font-size: 0; } ul li{ display:block; height:57px; width:277px; } img{ vertical-align:bottom; }
解决方法2:
设置 img 的 margin-bottom: -5px;
ul{ width: 280px; font-size: 0; } ul li{ display:block; height:57px; width:277px; } img{ margin-bottom: -5px; }
解决方法3
设置 ul 的 font-size:0;
ul{ width: 280px; font-size: 0; } ul li{ display:block; height:57px; width:277px; }
4
解决方法4
使li浮动,并设置img为块级元素
ul{ width: 280px; } ul li{ float:left; display:block; height:57px; width:277px; } img{ display: block; }
工具/原料
包含img标签的任意源代码片段代码编辑器
方法/步骤
解决方法1:设置 img 的 vertical-align: bottom;
ul{ width: 280px; font-size: 0; } ul li{ display:block; height:57px; width:277px; } img{ vertical-align:bottom; }
解决方法2:
设置 img 的 margin-bottom: -5px;
ul{ width: 280px; font-size: 0; } ul li{ display:block; height:57px; width:277px; } img{ margin-bottom: -5px; }
解决方法3
设置 ul 的 font-size:0;
ul{ width: 280px; font-size: 0; } ul li{ display:block; height:57px; width:277px; }
4
解决方法4
使li浮动,并设置img为块级元素
ul{ width: 280px; } ul li{ float:left; display:block; height:57px; width:277px; } img{ display: block; }
相关文章推荐
- IE中img多出5px的空白解决4种方法
- img标签下多余空白BUG解决方法
- img标签下多余空白BUG解决方法 / div / img / 图片 / 空格
- img 标签下多余空白的解决方法
- js改变img标签的src属性在IE下出问题的解决方法
- img标签下多余空白BUG解决方法
- js改变img标签的src属性在IE下没反应的解决方法
- <img/>标签onerror事件在IE下的bug和解决方法
- li元素中包含img元素出现5px空白的解决方法
- img 标签下多余空白的解决方法
- 【转】img标签下多余空白BUG解决方法-DivCSS教程
- <img/>标签onerror事件在IE下的bug和解决方法
- js改变img标签的src属性在IE下没反应的解决方法
- <img/>标签onerror事件在IE下的bug和解决方法
- js改变img标签的src属性在IE下没反应的解决方法
- IE下img多余5像素空白解决方法
- 桌面IE图标不见了的4种解决方法
- IE下a标签中内容为空,在页面中无法显示其hover样式的解决方法
- 解决IE中img.onload失效的方法
- IE下a标签中内容为空,在页面中无法显示其hover样式的解决方法