Kye
Kye

Reputation: 4495

Bootstrap Glyphicon as button

Say I wanted to use a glyphicon as a submit button for a form. How would I go about doing this?

To elaborate, I want no 'visible' elements of a traditional button. Just a glyphicon, as it would appear normally in text.

I have tried using <button> and <input type='button'> with the glyphicon classes, and (as one would expect), no luck.

Upvotes: 8

Views: 30099

Answers (2)

omma2289
omma2289

Reputation: 54619

You can use the .btn-link class to have a button appear as a text link:

<form>
...
<button type="submit" class="btn btn-link">
    <span class="glyphicon glyphicon-star"></span>
</button>
</form>

See this demo fiddle

Upvotes: 30

Luke
Luke

Reputation: 4063

<button type="button" class="btn btn-default">
    <span class="glyphicon glyphicon-search"></span>
</button>

Give this a read

Upvotes: 0

Related Questions