我正在尝试创建一个带有两种色调背景的HTML表格单元格;所以我在左侧有黄色背景和右侧有绿色背景的正常文本背景下。目前为止,最接近的是以下内容。背景已经正确实现了一半一半,但是内容文本被移到了背景下面。
<html>
<head>
<style type='text/css'>
td.green
{
background-color: green;
padding: 0px;
margin: 0px;
height:100%;
text-align:center
}
div.yellow
{
position:relative;
width: 50%;
height: 100%;
background-color:yellow
}
</style>
</head>
<body style="width: 100%">
<table style="width: 25%">
<tr style="padding: 0px; margin: 0px">
<td class="green">
<div class="yellow"></div>
<div class="content">Hello</div>
</td>
</tr>
</table>
</body>
</html>
我该如何修复这个问题?