Replace 'Submit' button with Boostrap Glyphicon?

I’ve read this thread on how to change a submit button to a Glyphicon. In my case, it doesn’t seem to be working.

I’m using this:
<input value="" class="glyphicon glyphicon-search" type="submit">

But it turns out like this:

Bootstrap Glyphs are loading because I’m using them throughout the site.

I can add a span tag within/wrap around the tag, but I was hoping to get the to accept the classification (or somehow do so).

Anything specific I should be looking at?

Did you try using a button like in that thread?

Glyphicons are created using the content property and the :before pesudo class and they don’t apply to replaced elements such as images or inputs (there is no before or after to an image and an input doesn’t really have any content apart from that supplied in its value attribute).

You need to use the button element as mentioned in that other thread.:slight_smile:

EDIT:
I’m not sure if this is well supported but you could try putting the hex value (&#xe003") into the value attribute.

e.g.

<input value="&#xe003" class="glyphicon glyphicon-search" type="submit">

I’m sure there will be accessibility issue with abusing the value attribute in that way,

1 Like

Yep! Works great! Thank you.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.