Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show an arrow down symbol with CSS

Tags:

css

unicode

fonts

I saw some nice styled dropdown boxes like this one and wanted to create my own one:

enter image description here

The CSS to create the arrow was quite simple. It just adds a unicode character as arrow as content to the :before class of an element;

.select:before{
    content: "\f0d7";
}

I tried it on my own, but the character is not shown, because the character is not contained in a default language like Arial:

http://jsfiddle.net/3cW9M/

I could of course include a font, that contains this character, but I think its to much overhead to add another ~100kb to the page just for the error.

Is there any other good solution to archive this arrow style without additional fonts or images?

like image 617
jan Avatar asked May 17 '14 00:05

jan


People also ask

How do I make a down arrow symbol?

To type the down arrow symbol anywhere on your PC or laptop keyboard (like in Microsoft Word or Excel), simply press down the Alt key and type 25 using the numeric keypad on the right side of your keyboard.


1 Answers

You may use other unicode or use borders : DEMO

.select:before{
    content: "\25be  or  \25bc  ?  ";
    float:right;
    color:gray;
}
.select:after{
    content: "";
    margin:0 0.5em;
    display:inline-block;
    border: 7px solid transparent;
    border-top:8px solid gray;
    border-bottom:0 none;
}
like image 87
G-Cyrillus Avatar answered Nov 10 '22 00:11

G-Cyrillus