gpt4 book ai didi

html - 图片不适合表格单元格

转载 作者:太空宇宙 更新时间:2023-11-04 12:57:01 25 4
gpt4 key购买 nike

我想构建一个设计如下图所示的页面:

enter image description here

因此在显示img 字样的地方,应该有适合该区域的图像。并且下面的文字不能高于左侧的图像。

我试着用这样的表来构建它

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style>
table { max-width: 100%; }
table, th, td { border-collapse: collapse;}
td img { width: 100%; max-width: 100%; height: auto;}
</style>
</head>
<body>
<table cellpadding="0" cellspacing='0' nowrap valign="baseline" border="0" style="width:100%; height:100%;">
<tbody>
<tr>
<td rowspan="3" colspan="3"><img src="http://www.si-faosmanlisabunlari.com/wp-content/uploads/not_included.jpg"/></td>
<td><img src="http://www.fxebay.de/img/gallery/fullsize/400x600.gif" /></td>
<td><img src="http://www.fxebay.de/img/gallery/fullsize/400x600.gif" /></td>
<td><img src="http://www.fxebay.de/img/gallery/fullsize/400x600.gif" /></td>
<td><img src="http://www.fxebay.de/img/gallery/fullsize/400x600.gif" /></td>
<td><img src="http://www.fxebay.de/img/gallery/fullsize/400x600.gif" /></td>
</tr>
<tr>
<td><img src="http://www.fxebay.de/img/gallery/fullsize/400x600.gif" /></td>
<td><img src="http://www.fxebay.de/img/gallery/fullsize/400x600.gif" /></td>
<td><img src="http://www.fxebay.de/img/gallery/fullsize/400x600.gif" /></td>
<td><img src="http://www.fxebay.de/img/gallery/fullsize/400x600.gif" /></td>
<td><img src="http://www.fxebay.de/img/gallery/fullsize/400x600.gif" /></td>
</tr>
<tr>
<td colspan="5">
<h3>Collezione UOMO FALLWINTER 14/15</h3>
Non rinuncia all’eleganza l’uomo DUNO, ma lo fa consapevole d’indossare un brand che è la nuova origine del vestire giovane. La linea uomo di DUNO per questa stagione è caratterizzata da capispalla, piumini e giacconi dallo stile inconfondibile. Comodi e dalla grande portabilità in ogni contesto, dall’evento speciale ai tour outdoor, i capi DUNO sono un alleato raffinato e solido.
</td>
</tr>
</tbody>
</table>
</body>
</html>

但是左边的图片并没有展开以适应所有的表格单元格......

我不知道我是否可以使用 div 或如何实现这一目标。

最佳答案

一个选项是使用背景图片代替:

background:url('not_included.jpg') center no-repeat;
background-size:cover;
width:300px;

关于html - 图片不适合表格单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25746921/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com