Bootstrap - 输入组 btn 不会剪辑到输入组 [英] Bootstrap - Input-group-btn doesn't clip to input-group

查看:23
本文介绍了Bootstrap - 输入组 btn 不会剪辑到输入组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是引导程序的新手,我正在尝试在我的网络应用程序中实现它.我想对三个不同的部分进行分组以使其看起来不错,但下面代码的结果使

I'm new to bootstrap and I'm trying to implement it in my web app. I want to group three different parts so that its looking nice, but the result of the code below makes the <button> float to the right side of the browser.

I think this means the grouping works, since its on the same row. But somehow the <button> still doesn't clip to the <input/>. I've used This bootstrap components page as a reference/example to make generate my code.

My question: How do I make the <button> "clip/snap" onto the <input/> ?

<div class="input-group">
<div class="input-group-addon">
    Add project:
</div>
<input type="text" class="form-control input-group" placeholder="Type new project here"/>
<div class="input-group-btn">
    <button type="button" class="btn btn-default ">Add</button>
</div>

This is what my result looks like (Note: contains different text, but the code is the same):

解决方案

Use the class pull-left, this will clip it to the <input/>. See updated code below:

<div class="input-group">
<div class="input-group-addon">
    Add project:
</div>
<input type="text" class="form-control input-group" placeholder="Type new project here"/>
<div class="input-group-btn pull-left"> <!-- add pull-left here -->
    <button type="button" class="btn btn-default ">Add</button>
</div>

这篇关于Bootstrap - 输入组 btn 不会剪辑到输入组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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