如何在CSS元素之后添加一个downarrow?

时间:2013-10-15 07:43:30

标签: css

我想在this page

的可排序表格中添加箭头

我尝试将此代码添加到css:

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

table th.headerSortDown:after {
   content: " ↓";
}

但是,这不会显示箭头"↑" and "↓",而是显示html实体:"↑" and "↓"

甚至更好的是我在这里找到的向上和向下箭头: http://graphemica.com/search?q=ARROW+TO+BAR

1 个答案:

答案 0 :(得分:9)

尝试使用他们的unicode位置

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

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

table th:after {
   color: #123456;
}

有关其他箭头符号,请参阅http://www.blooberry.com/indexdot/html/tagpages/entities/arrow.htm