我有一个表中的内容:
<td>1</td>
<td>2</td>
<td>3</td>表格单元格本身有样式(如背景颜色和边框),但我希望在数字周围有一个圆圈(不使用图像),使用边框半径(高度,宽度等)……但我不想添加额外的标签。
:before {content:<span>;} 可以(以及它的:after选择器),因为我在呈现的级别包装了元素,但是content属性不会呈现HTML标记。
有没有办法做到这一点,或者我必须将每个单元格的内容包装在另一个标记中?浏览器兼容性是Mobile Safari (webkit),因为这是针对Cordova项目的,所以请使用您能想到的所有新方法。
发布于 2013-05-09 17:53:14
这样做怎么样?
<table>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</table>
td {
position: relative;
height: 40px;
width: 40px;
}
td:after {
content: '•';
color: #f00;
position: relative;
font-size: 90px;
left: -20px;
top: 23px;
z-index: -1;
}https://stackoverflow.com/questions/16458823
复制相似问题