解决:HTML页面中div框架图片拼接中间存在缝隙问题
修改之前代码如下:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>图片</title>
</head>
<body>
<div id="od" align="center" >
<div class="m" id="a">
<img src="1.jpg" height="400px" width="300px"/>
</div>
<div class="m" id="b" >
<img src="2.jpg" height="400px" width="300px"/>
</div>
<div class="m" id="c" >
<img src="3.jpg" height="400px" width="300px"/>
</div>
</div>
</body>
</html>
在父级div标签中添加如下属性:
style="font-size: 0%"
修改代码之后如下:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>图片</title>
</head>
<body>
<div id="od" align="center" style="font-size: 0%" >
<div class="m" id="a">
<img src="1.jpg" height="400px" width="300px"/>
</div>
<div class="m" id="b" >
<img src="2.jpg" height="400px" width="300px"/>
</div>
<div class="m" id="c" >
<img src="3.jpg" height="400px" width="300px"/>
</div>
</div>
</body>
</html>
效果如下: