Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.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_Image_Css Tables - Fatal编程技术网

Html 表格显示问题:图像块

Html 表格显示问题:图像块,html,css,image,css-tables,Html,Css,Image,Css Tables,我正试图在我的主页上的图片旁边放一些文字。因为我希望我的主页能够响应,所以我使用了一个表来实现这一点,使用CSS: #tablehomepage { display: table; } #tablehomepage img { min-width: 280px; min-height: 190px; } #tablehomepage body { vertical-align: top; } @media (max-width: 920px) {

我正试图在我的主页上的图片旁边放一些文字。因为我希望我的主页能够响应,所以我使用了一个表来实现这一点,使用CSS:

    #tablehomepage {
    display: table;
}

#tablehomepage img {
    min-width: 280px;
    min-height: 190px;
}

#tablehomepage body {
    vertical-align: top;
}


@media (max-width: 920px) {
    #tablehomepage td {
        display: block;
    }
完整代码:。奇怪的是,这里没有出现问题

我的图像在第一个单元格中,文本在第二个单元格中。只有一排

我目前有一些问题:

  • 当屏幕低于920时,“display:block”开始显示,但会将我的文本放在图像周围。我想在较小的屏幕上显示图像下方的文本
  • 当“display:block”启动时,一些额外的随机边框出现在我的上边框下面
  • 我无法将图像自动缩放到与不同屏幕尺寸的文本很好地匹配的位置。我想这可以通过设置单元格的静态大小并将图像作为背景放到css中来实现,但是我不能设置alt text(SEO对我来说非常重要)
    尝试将显示设置为
    内联块
    ,对于文本,添加
    清除:展位
    ,这样它将需要全行宽度,并且不会出现在您的图像周围。

    请发布完整的代码示例。这是我的代码:对不起,我应该更清楚一些。您的问题应该包含完整的代码示例。作为可选的第二步,您可以创建一个第三方示例,如jsFiddle