Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add whitepaces with ::before selector [duplicate]

I have tried this but it didn't work:

.stackoverflow::before {
    font-family: 'FontAwesome';
    content: "\f16c ";
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
<a class="stack-link stackoverflow" href="http://stackoverflow.com">StackOverflow</a>

Can we add whitespace(s) with ::before selector and content property like that?

like image 914
dan9vu Avatar asked Oct 30 '22 02:10

dan9vu


1 Answers

Yes, You can add whitespace like this content: "\f16c \00a0";

Jsfiddle

\00a0 is hex code for a non-breaking space,used in content property. More Info

Hope it helps :)

like image 145
Thinker Avatar answered Nov 11 '22 07:11

Thinker