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

标签 css

<分区>

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

我尝试的是将这段代码添加到 css 中:

table th.headerSortUp:after {
   content: " &uarr;";
}

table th.headerSortDown:after {
   content: " &darr;";
}

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

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

最佳答案

尝试改用他们的 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

关于css - 如何使用 CSS 在元素后添加向下箭头?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19375764/

相关文章:

html - 页面底部的 Bootstrap 页脚

css - 将奇偶样式定位到具有 id 的特定表

java - 我应该把我的 css 文件放在 Intellij IDEA 的什么地方

jquery - 将图像的比例从 100vh 动画化到 100% 宽度

javascript - 如何将所有计算样式设置为元素上的文字样式?

html - 删除 anchor 标记内图像的边框

html - 如何将可扩展的 div 对齐到始终居中/居中的元素的一侧 - css

javascript - 基础自定义选择在按钮栏内不起作用

html - Div 用于 HTML 电子邮件的图像

html - CSS - 仅在绝对需要时才在 div 中包装文本