简体   繁体   English

img标签底部有空白

[英]img tag having white space at the bottom

I'm creating a wordpress page and creating a certain part with background image, The main issue was, one of the image in css is being cut or split here is the link to the site: 我正在创建一个wordpress页面并创建带有背景图像的特定部分,主要问题是,css中的一个图像被剪切或分割了,这里是该站点的链接:

http://testpress.dramend.com/amend-2/ the image being split was loopmid.gif which was not connecting to looptop.gif here is the screenshot: http://testpress.dramend.com/amend-2/所分割的图像是loopmid.gif,它没有连接到looptop.gif,这是屏幕截图:

在此处输入图片说明

<tr>
   <td height="23"><img width="707" height="23" alt="" src="http://dramend.com/looptop.gif"></td>
</tr>

Have I done anything wrong in my CSS? 我在CSS中做错了什么吗?

Thanks 谢谢

You need to use display: block; 您需要使用display: block; or you can use vertical-align: bottom; 或者您可以使用vertical-align: bottom; as well for the img tag since it is inline element by default...that will solve the issue. 也适用于img标签,因为默认情况下它是inline元素...将解决此问题。

Also, you are using table for designing layouts which is just dirty.. Learn CSS Positioning, floats, and make layouts using other tags like div , section etc 另外,您正在使用table设计肮脏的布局。.学习CSS定位,浮动和使用其他标签(例如divsection等)进行布局

与其使用表格进行设计,不如尝试使用div和CSS定位

Since you are using table for designing layout, which is not suggested as Mr.Alien said, you may use display:table; 由于您使用table来设计布局,这并不像Alien先生所建议的那样,因此可以使用display:table; ;。 for that img tag as well. 以及该img标签。

In your css file please add following lines: 在您的css文件中,添加以下行:

table, td, tr {
   margin:0; 
   padding:0;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM