HEH
HEH

Reputation: 305

content property is not working correctly

I'm using css content property but it is not working as expected.

content: "\f104";

should display < but all my content properties are showing a square character.

Upvotes: 3

Views: 9120

Answers (3)

Alex Freeman
Alex Freeman

Reputation: 21

You need use this construction in CSS for example:

.yourclass:before {
     content: '\f104';
     display: inline-block;
     font: 14px/1 FontAwesome;
     font-size: 14px;
     font-size: inherit;
     text-rendering: auto;
}

Before using this code "Awesome Font" in is required!

Upvotes: 1

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201588

The notation "\f104" denotes, by definition, the Unicode code point U+F104, which is in the Private Use Area. This means that no character is assigned to the code point in the Unicode standard, and it has a meaning only by private agreements. Therefore, Private Use code points should not be used in public information interchange, e.g. on web pages.

Some font trickeries are known to use Private Code points for various glyphs, often specialized icons. On web pages, they work (when they work) only via @font-face definitions that make use of the specific font. When they do not work, browsers typically render a generic symbol of an unrepresentable or unknown character, such as a small rectangle.

To use the character “<” (LESS-THAN SIGN) in the content attribute, it is simplest to write it as such:

content: "<";

Upvotes: 4

HEH
HEH

Reputation: 305

I had to include font awesome css http://astronautweb.co/snippet/font-awesome/ http://fortawesome.github.io/Font-Awesome/get-started/ I was just copying something done in another website and now it is working thank u all

Upvotes: 1

Related Questions