Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How add a downarrow after an element with CSS? [duplicate]

Tags:

css

I would like to add arrows to my sortable table on this page

What I tried is adding this code to the css:

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

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

But that will not display the arrows "↑" and "↓" but the html-entities instead: "↑" and "↓"

or even better would be the up- and downward arrow I found here: http://graphemica.com/search?q=ARROW+TO+BAR

like image 621
rubo77 Avatar asked Oct 15 '13 07:10

rubo77


People also ask

How do you add up and down arrows in select box?

This is accomplished by increasing the select's width by the width of your new arrows, and adding the same amount to the parent p 's right padding. One way to change the select's width is by using calc(100% + 30px) .

How do I change the position of a dropdown arrow in CSS?

There is no special pseudo elements for select dropdown icon in css. But you can change the position of the icon by background property. Or else use this kind of "height" or "line-height" for good look.


1 Answers

try using theirs unicode positions instead

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

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

table th:after {
   color: #123456;
}

See http://www.blooberry.com/indexdot/html/tagpages/entities/arrow.htm for other arrow symbols.

like image 139
Fabrizio Calderan Avatar answered Oct 20 '22 17:10

Fabrizio Calderan