gpt4 book ai didi

forms - Twitter Bootstrap : Stop input field extending beyond well

转载 作者:行者123 更新时间:2023-12-04 04:47:54 25 4
gpt4 key购买 nike

我在尝试解决此问题时遇到了麻烦。文档说我应该将跨度设置为等于父跨度,但是,当我这样做时,它会延伸到井容器的右侧。在移动设备上查看时看起来不错(向右延伸适当的量,填充井),但是,它在桌面上播放效果不佳(我希望字段在井内延伸)。

<div class="container">
<div class="row">
<div class="span4 offset4">
<div id="login-panel">
<div class="well bordered clearfix">
<div class="text-center">
<div class="page-header" style="border-bottom: none; margin: 0;">
<img src="library/img/logo-01.png"/>
</div>
</div>
<form method="POST" action="#" accept-charset="UTF-8" class="pull-left">
<legend>App name</legend>
<div class="control-group ">
<!-- username field -->
<div class="controls">
<label>Email</label>
<input class="span4" type="text" name="email" value="" id="email" placeholder="Your email address">
</div>
</div>

<div class="control-group">
<label>Password</label>
<!-- password field -->
<input type="password" name="password" id="password" placeholder="Password">
</div>
<div class="control-group ">
<p>
<input class="btn btn-default pull-left" type="submit" value="Sign-up">
<input class="btn btn-primary pull-right" type="submit" value="Login">
</p>
</div>
</form>
</div>
</div>
</div>
</div> <!-- end row -->
</div> <!-- end container -->

最佳答案

文档实际上是在说:

Use .span1 to .span12 for inputs that match the same sizes of the grid columns.



但是你想做一个全角 <input> , 正确的?

制作 <input>采取全宽
input.full-width {
box-sizing: border-box;
width: 100%;
height: 30px;
}

同时删除 .pull-left来自 <form> .看看它是如何在 this fiddle 上工作的.

编辑

自 Bootstrap 2.2.0 起使用捆绑的 input-block-level类来实现这个效果。

关于forms - Twitter Bootstrap : Stop input field extending beyond well,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12195931/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com