如何使用CSS在元素后添加向下箭头?

如何使用CSS在元素后添加向下箭头?,css,Css,我想在上的可排序表中添加箭头 我尝试将以下代码添加到css中: table th.headerSortUp:after { content: " ↑"; } table th.headerSortDown:after { content: " ↓"; } 但这不会显示箭头”↑" 及"↓“但html实体为:”↑“和”↓“ 或者更好的是我在这里找到的上下箭头: 尝试使用他们的unicode位置 table th.headerSo

我想在上的可排序表中添加箭头

我尝试将以下代码添加到css中:

table th.headerSortUp:after {
   content: " ↑";
}

table th.headerSortDown:after {
   content: " ↓";
}
但这不会显示箭头
”↑" 及"↓“
但html实体为:
”↑“和”↓“

或者更好的是我在这里找到的上下箭头:

尝试使用他们的unicode位置

table th.headerSortUp:after {
   content: " \2191";
}

table th.headerSortDown:after {
   content: " \2193";
}

table th:after {
   color: #123456;
}

有关其他箭头符号,请参见。

谢谢,我使用了\2912和\2913作为⤒ 及⤓ 现在。我怎样才能给箭头一种比th的其他内容更为不同的颜色呢?请参阅更新的答案。我在您的帮助下解决了这个问题,如下所示:也请参阅