Adding an Ï Class (icon) to a button

Adding an Ï Class (icon) to a button

Hi Guys,

I am currently implementing Twitter Bootstrap with my Agile project. There is a class used for icons displayed on buttons:

<button class="btn btn-inverse">
<i class="icon-refresh icon-white"></i> Update</button>

How can i create an "ï class" for a button without using HTML/Non escaped content?



Hi Robbie,

The html generated by the platform for buttons is <input type="submit" value="CONTENT" /> and not <button>CONTENT<button>, which limits our ability to inject the html elements used for Twitter Bootstrap's icons.

That said, it is still possible to use anchors (styled as buttons) to achieve the same visual result (as seen here:

This structure seems to do the trick:
- Link (style="btn")
- Container (style="icon-github")
- Text

It results in this HTML:

<a class="btn" href="#">
<div class="icon-github"></div>
and that seems to play nice with the [small] icons in font-awesome's page.

Hope that helps.

All the best,