我正在添加文本框並動態選擇元素,其中一個佔據容器標籤的整個寬度後會添加到第二行。但我不希望第二線,insted的我應該得到一個水平滾動條,如果容器的寬度不足以容納所有標籤如果容器寬度不夠,如何使HTML元素不跨越第二行?
<div class="addContainer">
<label class="select ">
<select class="form-control" name="selecname" placeholder="" id="id1">
<option value="1">Pass</option>
<option value="0">Fail</option>
</select><i></i>
</label>
<label class="select ">
<select class="form-control" name="selecname" placeholder="" id="id1">
<option value="1">Pass</option>
<option value="0">Fail</option>
</select><i></i>
</label>
<label class="select ">
<select class="form-control" name="selecname" placeholder="" id="id1">
<option value="1">Pass</option>
<option value="0">Fail</option>
</select><i></i>
</label>
<label class="select ">
<select class="form-control" name="selecname" placeholder="" id="id1">
<option value="1">Pass</option>
<option value="0">Fail</option>
</select><i></i>
</label>
<label class="select ">
<select class="form-control" name="selecname" placeholder="" id="id1">
<option value="1">Pass</option>
<option value="0">Fail</option>
</select><i></i>
</label>
<label class="select ">
<select class="form-control" name="selecname" placeholder="" id="id1">
<option value="1">Pass</option>
<option value="0">Fail</option>
</select><i></i>
</label>
<label class="select ">
<select class="form-control" name="selecname" placeholder="" id="id1">
<option value="1">Pass</option>
<option value="0">Fail</option>
</select><i></i>
</label>
<label class="select ">
<select class="form-control" name="selecname" placeholder="" id="id1">
<option value="1">Pass</option>
<option value="0">Fail</option>
</select><i></i>
</label>
<label class="select ">
<select class="form-control" name="selecname" placeholder="" id="id1">
<option value="1">Pass</option>
<option value="0">Fail</option>
</select><i></i>
</label>
<label class="select ">
<select class="form-control" name="selecname" placeholder="" id="id1">
<option value="1">Pass</option>
<option value="0">Fail</option>
</select><i></i>
</label>
<label class="select ">
<select class="form-control" name="selecname" placeholder="" id="id1">
<option value="1">Pass</option>
<option value="0">Fail</option>
</select><i></i>
</label>
<label class="select ">
<select class="form-control" name="selecname" placeholder="" id="id1">
<option value="1">Pass</option>
<option value="0">Fail</option>
</select><i></i>
</label>
<label class="select ">
<select class="form-control" name="selecname" placeholder="" id="id1">
<option value="1">Pass</option>
<option value="0">Fail</option>
</select><i></i>
</label>
這裏是用於演示的鏈接http://jsfiddle.net/5mwFL/
添加一些HTML標記請。 –
使用空格:nowrap或保留最小寬度的選擇框 –
溢出:隱藏或滾動 –