在 twitter bootstrap 2 中添加图标以提交按钮 [英] Add icon to submit button in twitter bootstrap 2

查看:27
本文介绍了在 twitter bootstrap 2 中添加图标以提交按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的表单输入提交按钮上使用 Twitter 引导程序图标.

http://twitter.github.com/bootstrap/base 上的示例-css.html#icons 主要显示样式化的超链接.

我最接近的是让图标显示在按钮旁边,但不在里面.

<span class="add-on"><i class="icon-user icon-white"></i></span><input type="submit" class="btn-primary" value="登录" >

解决方案

您可以使用按钮标签代替输入

I want to use the twitter bootstrap icons on my form input submit buttons.

The examples on http://twitter.github.com/bootstrap/base-css.html#icons mainly show styled hyperlinks.

The closest I've come is getting the icon displayed next to the button, but not inside.

<div class="input-prepend">
   <span class="add-on"><i class="icon-user icon-white"></i></span>
   <input type="submit" class="btn-primary" value="Login" >
</div>

解决方案

You can use a button tag instead of input

<button type="submit" class="btn btn-primary">
  <i class="icon-user icon-white"></i> Sign in
</button>

这篇关于在 twitter bootstrap 2 中添加图标以提交按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆