Css 如何右对齐引导窗体按钮?
请告诉我如何右对齐此表单“登录”按钮使用引导。我累了,要用拉对课。但在调整大小后,我的按钮不在正确的位置Css 如何右对齐引导窗体按钮?,css,twitter-bootstrap,Css,Twitter Bootstrap,请告诉我如何右对齐此表单“登录”按钮使用引导。我累了,要用拉对课。但在调整大小后,我的按钮不在正确的位置 <div role="form"> <div class="form-group"> <label>Username</label> <input type="text" class="form-control"/> </div> <div class="f
<div role="form">
<div class="form-group">
<label>Username</label>
<input type="text" class="form-control"/>
</div>
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control"/>
</div>
<div class="checkbox">
<label>
<input type="checkbox"> Remember Me
</label>
</div>
<button class="btn-info btn">Log in</button>
</div>
用户名
密码
记得我吗
登录
您可以使用文本权限
首先,您必须将其包装在div中,如下所示:
<div class="text-right">
<button class="btn-info btn">Log in</button>
</div>
登录
这是完整的代码
<div role="form">
<div class="form-group">
<label>Username</label>
<input type="text" class="form-control"/>
</div>
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control"/>
</div>
<div class="checkbox">
<label>
<input type="checkbox"/> Remember Me
</label>
</div>
<div class="text-right"> <!--You can add col-lg-12 if you want -->
<button class="btn-info btn">Log in</button>
</div>
</div>
用户名
密码
记得我吗
登录
向右拉
工作正常
登录
如果您在Bootstrap4中有行和列的容器中,则所有浮动都不能正常工作
相反,您必须添加一个间隔列以使内容对齐
漂浮在容器流体中的右演示,引导4
.col auto(类似于右侧浮动)
您是否尝试过类向右拉
?是的,但完成后,按钮下降。调整浏览器大小时,我看不到任何问题。在这里检查。我支持这个。使用pull right
浮动元素通常会导致不希望出现的布局问题。text-right用于引导表单,而pull right会将按钮置于表单外部,因此如果表单具有bkg,则按钮将位于bkg外部
<button class="btn-info btn pull-right">Log in</button>