Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
222 views
in Technique[技术] by (71.8m points)

html - fontawesome icon not appear in place holder

in my code below i'm trying to use an icon in placeholder but it's not appearing , is there a way to solve this?

enter image description here

input.empty {
    font-family: FontAwesome;
    font-style: normal;
    font-weight: normal;
    text-decoration: inherit;
}
<div class="form-group">
                <input
                  class="form-control empty" 
                  v-model="login.password"
                  label="Password"
                  type="password"
                  minlength="6"
                  placeholder="&#xF002;"
                  required
                />
question from:https://stackoverflow.com/questions/65888834/fontawesome-icon-not-appear-in-place-holder

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

FontAwesome 5

Uses the font-family: Font Awesome 5 Free;

input {
  font-family: 'Font Awesome 5 Free';
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/solid.min.css" rel="stylesheet"/>

<input
    class="form-control empty" 
    v-model="login.password"
    label="Password"
    type="password"
    minlength="6"
    placeholder="&#xF002;"
    required
/>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...