Html 将背景图像放置在表格单元格的中间
请看下图 如何使图像在表格中居中(Html 将背景图像放置在表格单元格的中间,html,css,html-table,Html,Css,Html Table,请看下图 如何使图像在表格中居中()?填充不在顶部留出空间,仅在右侧和底部留出空间 下面是表格html代码 <table> <tbody> <tr> <td class="bedButton ward-A">A115:1</td> <td class="bedButton ward-A">A116:1</td> </tr> </tbody> </table> 要使文本水平居
)?填充不在顶部留出空间,仅在右侧和底部留出空间
下面是表格html代码
<table>
<tbody>
<tr>
<td class="bedButton ward-A">A115:1</td>
<td class="bedButton ward-A">A116:1</td>
</tr>
</tbody>
</table>
要使文本水平居中,请使用:
td {
text-align:center;
}
<强>
你是指在TD的中间对齐文本??文本对齐,垂直居中对齐?不,我的意思是在=)的中心对齐背景图像。哦,你可能想编辑这个问题来明确你想做什么。背景位置:中心;可能会这样请包含背景图像的绝对URL,因为我们看不到背景。background.position完成了,谢谢:)背景图像怎么样?背景:url(../images/bedview/bed background.png)无重复;?=)在背景的位置部分设置
50%50%
,如background:url('http://www.placekitten.com/250/300“)不重复50%50%代码>。看见
td {
text-align:center;
}