我試圖顯示3 div
s內聯並嘗試使用容器div
並將其設置爲使用inline-block
但是,這並不奏效。我是否錯過了明顯的東西?如何在此示例中顯示div內聯
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div class="tablebox" id="box1" style="display: inline-block; border: solid 1px black; width:500px; height:200px;">
<form class="form-horizontal">
<fieldset>
<legend>Form</legend>
<div class="form-group">
<label class="col-md-4 control-label" for="selectbasic">Fill this in</label>
<div class="col-md-4">
<select class="form-control" id="selectbasic" name="selectbasic">
<option value="1">Option 1</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label" for="selectbasic">Option 2</label>
<div class="col-md-4">
<select class="form-control" id="selectbasic" name="selectbasic">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
</select>
</div>
</div>
</fieldset>
</form>
</div>
<div id="example">
<div style="width:100%; white-space:nowrap;">
<span style="display: inline-block; vertical-align: top; padding: 5px; margin-left: 10px;"></span>
</div>
<div id="wrapping">
<span style="display: inline-block; vertical-align: top; padding: 5px; margin-left: 10px;"></span>
<div class="boxer" id="box1" style="border: solid 1px black; width:150px; height:400px;">
<span style="display: inline-block; vertical-align: top; padding: 5px; margin-left: 10px;"></span>
<p><span style="display: inline-block; vertical-align: top; padding: 5px; margin-left: 10px;">Sort these</span></p>
</div>
<div class="box" id="box2" style="border: solid 1px black; width:1000px; height:400px;">
<span style="display: inline-block; vertical-align: top; padding: 5px; margin-left: 10px;"></span>
</div>
</div>
</div>
</body>
</html>
你的標籤是**所有的地方**。 –
你試圖使內聯完全一致嗎? –
float:left? – Tester