I'm trying to make a font awesome icon (empty square) clickable inside a form post. However, the code I tried showed the icon inside a button. I do not need the button, not the aesthetic I am looking for (see attached screenshot). Any thoughts? I am using this html code (showing the submit code only to keep it simple):
<!--input type="image" class="fa fa-square-o fa-lg" /-->
<button type="submit" id="completed-task">
<i class="fa fa-square-o fa-lg"></i>
</button>
The font-awesome icon can be placed by using the fa prefix before the icon's name. Example: In this example, we will take a form where the input field is necessary. After that, we will place the font-awesome icon inside the input field. We will use the CDN link to use the font-awesome icons.
Open our free Bootstrap Form Builder in your browser. Add a field from the "Add a Field" tab. Select "Icon" from the Prepend or Append dropdown in the "Edit Fields" tab. Choose an icon from the icon picker window.
You should find it in File >> Glyphs >> Select Fontawsome. Hope it helps.
Add Icons to HTML We recommend using <i> element with the Font Awesome CSS classes for the style class for the style of icon you want to use and the icon name class with the fa- prefix for the icon you want to use.
You can hide the button by taking away the border, background and padding;
<button type="submit" id="completed-task" class="fabutton">
<i class="fa fa-square-o fa-lg"></i>
</button>
.fabutton {
background: none;
padding: 0px;
border: none;
}
@import url('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');
.fabutton {
background: none;
padding: 0px;
border: none;
}
<button type="submit" id="completed-task" class="fabutton">
<i class="fa fa-square-o fa-lg"></i>
</button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With