在Twitter引导程序中是否有类似于Foundation的前缀表单标签?



我开始在我的Web项目中使用Foundation 5,但它似乎充满了错误,表单验证根本不起作用。所以我切换到Bootstrap。

但是,Foundation中有一个名为Pre/Postfix Label & Actions的功能(见这里),我希望它在Bootstrap中。

我已经搜索了又搜索,但找不到任何甚至非常相似的东西。我可以使用 glyphicon,glyphicon glyphicon-gbp 在表单输入之前显示"£"符号,但是我无法使用网格系统使其正确流动。

我这里有一个JS小提琴:http://jsfiddle.net/kAnjN/

这是我的 HTML:

<div class="container">
<form class="form-horizontal">
    <div class="form-group">
        <label for="monthly_rent" class="col-sm-2 control-label">Monthly Rent</label>
        <div class="col-sm-4">
            <span class="glyphicon glyphicon-gbp"></span>
            <input type="text" name="monthly_rent" class="form-control">
        </div>
    </div>
</form>

有人有什么建议吗?我是一名PHP开发人员,像这样的前端事情让我感到沮丧!Bootstrap和Foundation应该让它更容易,只是"工作",但我总是需要寻找几个小时来寻找小问题的解决方案。

我基本上想实现上面基金会链接上的内容。

使用 .input-group 类:

<label for="monthly_rent" class="col-sm-2 control-label">Monthly Rent</label>
<div class="col-sm-4">
<div class="input-group">
    <span class="input-group-addon">
        <span class="glyphicon glyphicon-gbp"></span>
    </span>
        <input type="text" name="monthly_rent" class="form-control">
</div>
</div>

最新更新