我正在尝试使用下面的代码在背景中获取图像,这样我就可以在上面写字,但图像不会出现在表格行的背景中。 图像和 html 页面。
<table background="aj1.jpg">
<tr>
<h4 align="center" style="font-size:20; font-family:Monotype Corsiva; color:black;">My Home</h4></tr>
<tr>
<h4 align="center" style="font-size:20; font-family:Monotype Corsiva; color:black;">Enjoy every moment.</h4>
</tr></table>
最佳答案
<table style = "background-image:url('aj1.jpg')">
<tr>
<td>
<h4 align="center" style="font-size:20; font-family:Monotype Corsiva; color:black;">My Home</h4></td></tr>
<tr>
<td><h4 align="center" style="font-size:20; font-family:Monotype Corsiva; color:black;">Enjoy every moment.</h4></td>
</tr></table>
background不是表格属性,需要使用style属性设置背景图片。
关于html - 如何在html中将图像放在背景中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20167823/