我尝试使用::before 和::after 将文本放在括号中的特定表格单元格中。单元格内容本身是从高级自定义字段表单中提取的,理论上会插入括号之间。
我有以下CSS
#ingredients td:nth-child(4)::before {content:"(";}
#ingredients td:nth-child(4)::after {content:")";}
左括号正常显示,但我无法显示右括号。我做错了什么?
最佳答案
您的代码,在这里工作正常...
#ingredients td:nth-child(4)::before {
content: "(";
}
#ingredients td:nth-child(4)::after {
content: ")";
}
<table id="ingredients">
<tr>
<td>blahblah</td>
<td>blahblah</td>
<td>blahblah</td>
<td>blahblah</td>
</tr>
</table>
关于css - 我无法获取::after 以在表格中显示内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44861418/