表单元格中的padding-bottom在CSS中不工作 [英] Table Cell padding-bottom in CSS not working

查看:212
本文介绍了表单元格中的padding-bottom在CSS中不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站上有一个表格,其中每个表格单元格包含一个138像素×138像素的图像。当我在CSS中使用padding:0px;表格单元格的大小最终为138px×143px。我没有看到为什么会发生这种情况的任何理由。即使我做padding-bottom:-5px;表保持在完全相同的大小。发生了什么!

I have a table on my website where each table cell contains an image that is 138px X 138px. When I style in CSS to have padding:0px; the table cell ends up with the size of 138px by 143px. I have not seen any reason as to why this is happening. Even when i do padding-bottom:-5px; the table remains at exactly the same size. What is happening!

CSS:

td
{
    width: auto;
    height: auto;
    padding: 0px;
} 

推荐答案


td img {
    vertical-align:top; /* or bottom */ 
}

这篇关于表单元格中的padding-bottom在CSS中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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