Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 将图像移动到单元格顶部_Html_Css_Web - Fatal编程技术网

Html 将图像移动到单元格顶部

Html 将图像移动到单元格顶部,html,css,web,Html,Css,Web,我想把图像放在手机的顶部,但是我不能再往上移动了,因为有一张网络的照片 我的CSS #animes { width: 130px; height: 100px; display: block; padding-left: 10px; padding-right: 10px; padding-top: -50px; } 将valign=top添加到单元格中。像这样 HTML: 这是垂直对齐的方法是的,祝你好运……你需要更具描述性,我甚至不知道你在问什么。可能会显示一些您尝

我想把图像放在手机的顶部,但是我不能再往上移动了,因为有一张网络的照片

我的CSS

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

将valign=top添加到单元格中。像这样

HTML:


这是垂直对齐的方法

是的,祝你好运……你需要更具描述性,我甚至不知道你在问什么。可能会显示一些您尝试过的示例代码。如果你希望得到帮助,你就需要在这个问题上投入更多的精力。我们都处于紧急状态,伙计。另外,我们可以从JS小提琴中看到这个问题吗?请注意,在HTML5中valign是不受欢迎的。如果你想要HTML5,就使用:td{vertical align:top;}
<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>
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; }