There seems to be no class for input type 'submit' in font-awesome. Is it possible to use some class from font-awesome for button input? I've added icons to all buttons (which actually links with class 'btn' from twitter-bootstrap) in my applications, but can't add icons on 'input type submit'.
Or, how to use this code:
input#image-button{
background: #ccc url('icon.png') no-repeat top left;
padding-left: 16px;
height: 16px;
}
html:
<input type="submit" id="image-button">Text</input>
(which I took from HTML: How to make a submit button with text + image in it?) with font-awesome?
Also possible like this
With multiple submits, when you need the value of the submit selected, this can be done quite easily. Just create a hidden field in your form and change its value depending on what button is clicked. For example, in the form, say you have:
Using jQuery:
Then you can retrieve the value of the button clicked in the "Clicked" post variable
Well, technically it's not possible to get
:before
and:after
pseudo elements work oninput
elementsFrom W3C:
So I had a project where I had submit buttons in the form of
input
tags and for some reason the other developers restricted me to use<button>
tags instead of the usual input submit buttons, so I came up with another solution, of wrapping the buttons inside aspan
set toposition: relative;
and then absolutely positioning the icon using:after
pseudo.HTML
CSS
Demo
Now here everything is self explanatory here, about one property i.e
pointer-events: none;
, I've used that because on hovering over the:after
pseudo generated content, your button won't click, so using the value ofnone
will force the click action to go pass through that content.From Mozilla Developer Network :
Hover the heart font/icon
Demoand see what happens if you DON'T usepointer-events: none;
use button type="submit" instead of input
for Font Awesome 3.2.0 use
HTML
Since
<input>
element displays only value of value attribute, we have to manipulate only it:I'm using

entity here, which corresponds to the U+F043, the Font Awesome's 'tint' symbol.CSS
Then we have to style it to use the font:
Which will give us the tint symbol in Font Awesome and the other text in the appropriate font.
However, this control will not be pixel-perfect, so you might have to tweak it by yourself.
You can use font awesome utf cheatsheet
here is the link for the cheatsheet http://fortawesome.github.io/Font-Awesome/cheatsheet/