Bootstrap Glyphicon作为按钮

Kye*_*e R 7 html css twitter-bootstrap

假设我想使用glyphicon作为表单的提交按钮.我该怎么做呢?

详细说明,我不希望传统按钮的"可见"元素.只是一个glyphicon,因为它通常会出现在文本中.

我已经尝试过使用<button><input type='button'>使用glyphicon类,并且(正如人们所期望的那样),没有运气.

koa*_*dev 22

您可以使用.btn-link该类将按钮显示为文本链接:

<form>
...
<button type="submit" class="btn btn-link">
    <span class="glyphicon glyphicon-star"></span>
</button>
</form>
Run Code Online (Sandbox Code Playgroud)

看这个演示小提琴