我试图将图标附加到输入。
字体很棒的字体可以在输入的值上附加该图标,如下所示:
<input class="btn" type="submit" value="">
到value=""
现在<i class="fa fa-sign-in"></i>
为止,的等价物在哪里是完美的,但是我需要将该图标放大,我该如何实现?或将图标附加到输入的另一种方法是什么?
和CSS
input[type="submit"] {
font-family: FontAwesome;
}
并且该图标必须位于左侧。
我会用 <button type="submit"></button>
@font-face {
font-family: FontAwasome;
src: url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/fonts/fontawesome-webfont.woff");
}
.sign-in:after {
content: '';
display: inline-block;
font-family: FontAwasome;
font-size: 2em;
line-height: 2.75rem;
height: 2.75rem;
vertical-align: top;
}
button {
background-color: blue;
border: none;
color: white;
min-height: 2.75em;
margin: 0;
padding: 0 1em;
}
<button type="submit" class="sign-in"></button>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句