2016-11-16 4 views
0

I Bild in CSS mit Bootstrap glyphicons ersetzen möchtenersetzen Bild mit Bootstrap Glyphicons

hier mein Code:

.inputShowPwd > .showpass { 

    display: none; 
    position: absolute; 
    height: 24px; 
    width: 24px; 
    top: 50%; 
    margin-top: -12px; 
    right: 6px; 
    background:url(image/show.png) 50% 50% no-repeat; 
} 

dies die Vorschau des Codes ist: preview

Eigentlich ist es funktionierte wollen, aber ich es mit Bootstrap glyphicons zu ersetzen, weil aus dem Bild angebracht ich, wenn ich in ihm, ich das Bild geworden Unschärfe

so möchte fragen, zeigen heran wie Bild mit Bootstrap Glyphicons in CSS ersetzen? jeder Vorschlag würde

Antwort

1

Hier Code meines Update Bild in CSS zu ersetzen und mit Schrift ehrfürchtigem

.inputShowPwd > .showpass { 
    display: none; 
    position: absolute; 
    height: 24px; 
    width: 24px; 
    top: 50%; 
    margin-top: -10px; 
    right: 2px; 
} 
.inputShowPwd > .showpass:after { 
    content:"\f06e"; /*this is unicode of eye on font awesome*/ 
    font-family: "FontAwesome"; 
} 

und dies ist die preview des Codes

es das Auge Schrift anzeigen ehrfürchtiges Symbol verwischt nicht, wenn ich hereinzoomiere

-1

Kasse Diese Suche Textbox mit glyphicon geschätzt.

#imaginary_container{ 
 
    margin-top:20%; /* Don't copy this */ 
 
} 
 
.stylish-input-group .input-group-addon{ 
 
    background: white !important; 
 
} 
 
.stylish-input-group .form-control{ 
 
\t border-right:0; 
 
\t box-shadow:0 0 0; 
 
\t border-color:#ccc; 
 
} 
 
.stylish-input-group button{ 
 
    border:0; 
 
    background:transparent; 
 
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> 
 
<div class="container"> 
 
\t <div class="row"> 
 
     <div class="col-sm-6 col-sm-offset-3"> 
 
      <div id="imaginary_container"> 
 
       <div class="input-group stylish-input-group"> 
 
        <input type="text" class="form-control" placeholder="Search" > 
 
        <span class="input-group-addon"> 
 
         <button type="submit"> 
 
          <span class="glyphicon glyphicon-eye-open"></span> 
 
         </button> 
 
        </span> 
 
       </div> 
 
      </div> 
 
     </div> 
 
\t </div> 
 
</div>

+0

Hallo, @Sachin Sanchaniya Dank für die Antwort auf meine Frage, ich möchte stattdessen in html das Auge Bild in CSS-Stil ersetzen. ich meinen Code auf CSS aktualisieren und es funktionierte bereits. .inputShowPwd> .showpass { /* Rahmen: 1px fest #ddd; */ Anzeige: keine; Position: absolut; Höhe: 24px; Breite: 24px; oben: 50%; Rand oben: -10px; rechts: 2px; } .inputShowPwd> .showpass: nach { Inhalt: "\ f06e"; font-family: "FontAwesome"; } –

+0

Er will, dass das Bild über CSS ersetzen und den HTML nicht restrukturieren. – Aslam

Verwandte Themen