-1
形式實現我想有設計像下面的圖片形式: 與引導
我試着用下面的代碼:
<form>
<div class="form-group form-inline">
<label for="exampleInputPassword1">Navn:</label>
<input type="text" class="form-control" id="exampleInputPassword1" placeholder="" data-required="true" name="navn">
</div>
<div class="form-group form-inline">
<label for="exampleInputPassword1">Bedrift:</label>
<input type="text" class="form-control" id="exampleInputPassword1" placeholder="" data-required="true" name="bedrift">
</div>
<div class="form-group form-inline">
<label for="exampleInputPassword1" class>Tlf:</label>
<input type="text" class="form-control" id="exampleInputPassword1" placeholder="" data-required="true" name="tlf">
</div>
<div class="form-group form-inline">
<label for="exampleInputEmail1">Mailadresse:</label>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="" data-required="true" name="mailadresse">
</div>
<input id="input-region" type="hidden" name="region" value="">
<button type="submit" class="btn btn-primary">Send</button>
</form>
但結果不是我所期待。
我把標籤和輸入放在一個白色的盒子上,而不使用標籤作爲佔位符。
爲什麼結果不符合您的預期? – Nathan
Bootstrap沒有任何組件可以自己做你想做的事情。你需要重寫CSS和/或用你自己的代碼修改HTML。可能應該給'form-group'一個白色的背景並刪除'form-control'元素的邊框。 –