Add whitepaces with ::before selector

This question already has an answer here:

  • Adding HTML entities using CSS content 9 answers

  • Yes, You can add whitespace like this content: "f16c 0a0";

    Jsfiddle

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

    Hope it helps :)


    Yep, use a0 it's   or non-breaking space.

    .stackoverflow::before {
        font-family: 'FontAwesome';
        content: "f16ca0a0a0a0a0a0";
    }
    <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>
    链接地址: http://www.djcxy.com/p/15546.html

    上一篇: 在元素之后使用:after添加空格(“”)

    下一篇: 在选择器之前添加空白