为什么放在 DIV 中间的图片下面会有间隙?

pig884 2009-04-28 10:29:05
为什么放在 DIV 中间的图片下面会有间隙?

为什么放在 DIV 中间的图片 会在 右边和下面出现间隙??

我查过很多文章,都说用 vertical-align:text-bottom; 可以解决,但是事实上根本不起作用

有没别的办法?
...全文
748 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
kuaiying001 2009-04-30
  • 打赏
  • 举报
回复
你用li把图片包起来,每个图片一个li,控制li,就不会有空隙了

空隙是<img> <img>这之间的空格产生的
cuixiping 2009-04-30
  • 打赏
  • 举报
回复
font-size:0是一个方法,但最好是把<img>和前后的<div>之间的空格和换行都去掉,并且<img>加上align="absmiddle",这样就没有空白了。

<div><img src="a.jpg" align="absmiddle" /></div>
caiying2009 2009-04-29
  • 打赏
  • 举报
回复
font-size:0px;


<div style="border:1px red solid;width:70px;height:70px;font-size:0px;">
<img src=http://avatar.profile.csdn.net/F/2/B/2_pig884.jpg>
</div>

claritytear 2009-04-29
  • 打赏
  • 举报
回复
空白是 设置了margin-bottom的效果
#logoban IMG {
MARGIN-BOTTOM: 5px;//这个去掉
VERTICAL-ALIGN: top; MARGIN-RIGHT: 4px
}
lm80458495 2009-04-28
  • 打赏
  • 举报
回复
页面上的层都是叠起来的 没有覆盖好 当然能看到啦
pig884 2009-04-28
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 bhbhxy 的回复:]
难得PIG哥不怨天尤人,肯学习技术啦?
[/Quote]

学技术有人要么??

白痴,

你以为可以吃技术吃到死么???
街头小贩 2009-04-28
  • 打赏
  • 举报
回复
出错在这个样式定义上
#logoban img {top.css (line 80)
margin-bottom:5px;
margin-right:4px;
vertical-align:top;
}
街头小贩 2009-04-28
  • 打赏
  • 举报
回复
try:
<img border="0" alt="首页顶部广告" src="uploadfiles/2009428470.jpg"/>
pig884 2009-04-28
  • 打赏
  • 举报
回复
你看这里:

http://www.shitangwang.com/index.asp

顶部那个广告
pig884 2009-04-28
  • 打赏
  • 举报
回复
还是不行啊
街头小贩 2009-04-28
  • 打赏
  • 举报
回复
这种也有局限性:

# <style type="text/css">
# .imageWrap{ width:200px; height:200px; text-align:center; border:#999 solid 1px; display:table-cell; vertical-align:middle; position:relative;}
# .imageWrap .outer{ +position:absolute; +top:50%;+left:0}
# .imageWrap .inner{ +position:relative; +top:-50%;+left:0}
# .imageWrap img{ display:block; margin:0 auto}
# </style>

bhbhxy 2009-04-28
  • 打赏
  • 举报
回复
难得PIG哥不怨天尤人,肯学习技术啦?

61,115

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧