0

I followed this question to have a placeholder at the end of the input which doesn't disappear when filling it (cf Airbnb's login modal for example).

However, I used Font Awesome's unicode and added a font family attribute but it doesn't work:

.email-container {
   width:100%;
    position: relative;
    float: left;
}

.email-container:after {
    position: absolute;
    right: 5px;
    color:#999999;
    top: 10px;
    content: '';
    font-family: FontAwesome;
}

I have  at the end of the line I'm trying to add the fa-envelope icon. Where did I miss something ?

2
  • Which icon you trying to use ? Commented Mar 7, 2016 at 10:48
  • Edited it: I want the fa-envelope icon. It does exist:  fa-envelope [] Are brackets necessary ? I've previously used Font Awesome's unicodes without it and it worked. fortawesome.github.io/Font-Awesome/cheatsheet Commented Mar 7, 2016 at 10:50

2 Answers 2

3

You have incorrect unicode charater notation. For CSS you should replace &#x with simple backslash \. Also ; at the end should be removed.

Here's the change you should do:

 => \f0e0

Try this:

.email-container:after {
    position: absolute;
    right: 5px;
    color:#999999;
    top: 10px;
    content: '\f0e0'; // <-- changed line
    font-family: FontAwesome;
}
2
  • Worked, thanks ! However: when should I use this notation and not the one provided in their cheat sheet ? I've used the '&#xf0e0;' notation before and it worked fine. Commented Mar 7, 2016 at 10:52
  • 1
    &#x0000; is a HTML entity. So you can use it when you place this char directly in HTML. More about HTML entities: w3schools.com/html/html_entities.asp Commented Mar 7, 2016 at 10:54
0

try this

content: " ("&#xf0e0")";

Not the answer you're looking for? Browse other questions tagged or ask your own question.