Add white areas with :: in front of the selector

I tried this, but this did not 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>
Run codeHide result

Is it possible to add spaces with a selector ::beforeand contenthow is it?

+4
source share
2 answers

Yes, you can add spaces like this content: "\f16c \00a0";

Jsfiddle

\00a0is the hexadecimal code for the non-breaking space used in the property content. Additional Information

Hope this helps :)

+2
source

Yes, use \a0it &nbsp;or inextricable space.

.stackoverflow::before {
    font-family: 'FontAwesome';
    content: "\f16c\a0\a0\a0\a0\a0\a0";
}
<html>
  <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>
</html>
Run codeHide result
0
source

All Articles