Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of content and backward slash in css

I have downloaded a site with a site downloader, which had nice icons on it. But after downloading it, that icons went away and I cannot see any image file.

In html, it's like this.

<li class="active">
   <a href="buttons.html">
      <i class="icon-up"></i> Buttons
   </a>
</li>

the class looks like below.

.icon-up:before {content: "\f0a6"; }

What is the meaning of that class definition's

:before
content

and

"\f0a6"
like image 775
bula Avatar asked Feb 14 '23 17:02

bula


1 Answers

Google really helps.

content denotes a real content that's put inside a css element. So, p:before {content: 'hello'} would put a string hello in front of the paragraph content. See here: http://jsfiddle.net/gRjRe/

The content you shown ("\f0a6") is just a Unicode value for a font character. See how they are used here, for example: http://astronautweb.co/snippet/font-awesome/

like image 177
Shomz Avatar answered Mar 06 '23 04:03

Shomz