How can I insert a calendar web font icon into my input field?
HTML:
<input class="start_date" type="text">
CSS:
.start_date:before {
font-family: "FontAwesome";
content: "\f073";
}
How can I insert a calendar web font icon into my input field?
HTML:
<input class="start_date" type="text">
CSS:
.start_date:before {
font-family: "FontAwesome";
content: "\f073";
}
<input>
is a self-closing tag, you cannot have any:before
or:after
pseudo element in it. You could wrap it into a<label>
or<span>
so and attach it there.Here is an example of having the icon positioned inside the input field.