图像展开表格单元格 [英] Image expands the table cell

查看:116
本文介绍了图像展开表格单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 600x90的图片,我想要一个 600x90尺寸的表格单元格

但我尝试溢出:隐藏和网络上的其他解决方案,但它仍然扩展了表格单元格以获取多张图片。



目前为止,我能获得的最佳效果是600x93,但它在底部留下了<3>空像素,看起来非常尴尬!

有人可以帮我找到一个解决方案吗?

解决方案

默认情况下图像有

  display:inline 

在大多数浏览器中添加3 -5像素到它的高度。



尝试设置像这样的图片的CSS:

  table.myTable td.withImage img {display:block; } 

并查看它是否有效。


I have an 600x90 picture and I want a table cell with exactly 600x90 dimensions.

But I tried overflow:hidden and some other solution on the net, but it still expands the table cell for a couple of pictures.

The best I could get so far is 600x93 but it leaves 3 empty pixels at the bottom, which looks very awkward!

Can someone help me on finding a solution?

解决方案

images by default have

display:inline

which in most browsers adds 3-5 pixels to it's height.

Try setting the css for the picture like this:

table.myTable td.withImage img { display:block; }

and see if it works.

这篇关于图像展开表格单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆