- <div class="row">
- <div>
- <label class="form-inline">參加單位:<input type="text" class="form-control" /></label>
- </div>
- </div>
主要就是添加form-inline就可以了
如果是一個文本框和一個按鈕的話那么只需要在外側用div包含,然后使用form-inline屬性就可以
- <div class="row">
- <div class="form-inline">
- <input type="text" class="form-control" placeholder="關鍵字" />
- <button class="btn btn-primary">搜 索</button>
- </div>
- </div>
在HTML中,讓兩個DIV在同一行顯示,就是通過float屬性來設置的,我們可以通過設置3個div,然后第一個div包裹住其他2個div,然后在設置寬高就可以了,我提交一段代碼:
<html>
<head>
<title>DIV的同行測試</title>
</head>
<body>
<div>
<div style='flaot:left; width:330px; height:200px;'>
<p>我是左邊的固定測試文字</p>
</div>
<div style='flaot:left; width:330px; height:200px;'>
<p>我是右邊的固定測試文字</p>
</div>
</div>
</body>
</html>