【发布时间】:2014-03-09 17:26:01
【问题描述】:
我有这个 HTML 代码,我只想将图像直接放在彼此之上。 (所以他们之间没有这条绿线) 如何做到这一点?
示例网址:http://todolist.x10.mx/test.html
HTML 代码:
<!DOCTYPE html>
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html">
</head>
<body bgcolor="green">
<img src="f.jpg" width="200" height="80" alt="plaatje1" style="border:none;padding:0px;spacing:0px;margin:0px"><br>
<img src="f.jpg" width="200" height="80" alt="plaatje2" style="border:none;padding:0px;spacing:0px;margin:0px"><br>
</body>
</html>
【问题讨论】:
-
第一张图片可以使用vertical-align =middle或margin bottom为-5px
-
内联元素没有顶部/底部边距。
-
@MohammedR.El-Khoudary
<img>是一个 replaced 内联元素,顶部/底部margin属性适用于图像。 Verify that. -
感谢您提供的信息 :-) 我不知道