下面是我的代码。
<!--Top Part-->
<div style="width: 100%; display: table;">
<div style="display: table-row">
<div style="width: 770px; height:270px; display: table-cell; background-color:#B2BABB;">
<p style="font-family: Allerta Stencil; font-size:40px; color:red; padding-top: 65;
padding-left:120;">SCOPE<br>Industries Berhad<br>
<span style="font-size:25px; color:black; font-family: Allan;">
A simple solution,<br></span>
<span style="font-size:25px; color:black; font-family: Allan; padding-left: 135;">
for a complex problem.</span></p>
</div>
<!-- Slideshow -->
<div style="display: table-cell; background-color:#F7DC6F ">
<img src="123.jpg" style="width:200;">
</div>
<!-- Slideshow End -->
最佳答案
在 CSS 中设置宽度时,您必须指定一个单位。因此,您需要使用 width: 200px
而不是 width: 200
。 px
代表像素。
或者,您可以尝试将图像宽度设置为 100%
。
关于html - 在单元格中拟合图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59638648/