html - HTML&CSS + Twitter Bootstrap:左侧的任何表单元素和右侧的按钮(行部分)
问题描述
我们需要 position Phone
, Name
, and Firstname
to left and button
to right。我尝试使用float-left
and float-right
,第一行是否可以,但之后是否更复杂。对于第二行,我尝试使用row
+ col-1..
but Phone
, Name
, and Firstname
not grouped with theinput
+--------------------------------------------------------------------------------+
| Title | button | |
+------------+-------------------------------------------------------------------+
| Phone | input | Name | input | Firstname | input | | button | |
+------------+-------------------------------------------------------------------+
| Content table |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+--------------------------------------------------------------------------------+
解决方案
你试过flexbox吗?
Bootstrap 自动边距示例:
<nav class="navbar">
<form class="form-inline w-100 d-flex">
<div class="form-group mr-4">
<label for="field-1"class="mr-2">Field #1</label>
<input class="form-control" id="field-1">
</div>
<div class="form-group mr-4">
<label for="field-1"class="mr-2">Field #2</label>
<input class="form-control" id="field-2">
</div>
<button class="btn btn-success ml-auto">Button</button>
</form>
</nav>
推荐阅读
- wordpress - .htaccess 重定向网址
- android - RecyclerView 为其项目设置错误的 MotionLayout 状态
- javascript - 如何在javascript中跟踪和保存虚拟滚动列表的最后滚动位置
- python - 在 pandas 数据帧上迭代函数的最快方法
- javascript - 在 NestJS 中使用 Mongoose 测试服务
- linux - 设置 Wno-dev 特别是 CMakeLists
- java - JAVA中的嵌套循环(线程)
- python - 如何更改 mplot3d 中的相机中心位置?
- javascript - 如何使用where和update
- zalenium - Zalenium idleTimeout 属性使用?