我需要在表格单元格中显示由一种颜色填充的圆圈.不知何故,我找到了一个有效但无法可靠运行的例子.请看下面的代码.
在IE上,圆圈变成垂直拉长的椭圆形.在具有更大细胞高度的Mozilla上也会发生同样的情况.
<!DOCTYPE HTML>
<html>
<head>
<title>circle</title>
<style type="text/css">
.circle_green {
width:1%;
padding:10px 11px;
margin:0 auto;
border:2px solid #a1a1a1;
border-radius:25px;
background-color:green;
}
</style>
</head>
<body>
<table border="1">
<tr>
<td>
<div class="circle_green"></div>
</td>
</tr>
</table>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)