我想将图像放在单元格顶部,但我无法向上移动,有网络照片
我的CSS
#animes {
width: 130px;
height: 100px;
display: block;
padding-left: 10px;
padding-right: 10px;
padding-top: -50px;
}
答案 0 :(得分:-1)
将valign =“top”添加到单元格。就像在这个fiddle
中一样HTML:
<table cellspacing="0" cellpadding="0" border="1">
<tr>
<td valign="top"><img src="https://www.smallbusinesssaturdayuk.com/Images/Small-Business-Saturday-UK-Google-Plus.gif"></td>
<td></td>
<tr>
</table>
CSS:
table{
width: 500px;
height: 300px;
}
/* If you want it done from CSS remove the valign and add in your css the following: */
td { vertical-align: top; }
以下是fiddle with vertical-align