2016-05-30 126 views
-6

我想把图像上池的顶部,但我不能再向上移动,还有就是网络移动图像到电池的顶部

Image

我的CSS的照片

#animes { 
    width: 130px; 
    height: 100px; 
    display: block; 
    padding-left: 10px; 
    padding-right: 10px; 
    padding-top: -50px; 
} 
+1

呀,祝你好运... –

+0

您需要更具描述性,我甚至不能说出你在问什么。也许显示一些你尝试过的东西的示例代码。如果你希望得到帮助,你必须在这个问题上付出更多的努力。 –

+4

我们都在紧急模式下,老兄。 –

回答

-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垂直对齐

+0

请注意'valign'在HTML5中已弃用。改用CSS。 –

+0

如果你想要HTML5,那么只需使用:td {vertical-align:top; } –