div에 jquery가있는 선택 드롭 다운을 동적으로 추가하고 있습니다. 중심에서 div로 시작하고 새로운 드롭 다운이 추가되어 센터에서 밖으로 바깥쪽으로 나가기를 원합니다.CSS를 사용하여 요소를 중앙에 유지하기
#pageMiddle{
width:940px;
margin:0 auto;
text-align: left;
position:relative;
}
#searchBar{
background: red;
width:500px;
margin: 0 auto;
}
#searchwrapper{
width:850px;
background: blue;
}
#searchwrapper form {
display:inline ;
margin: 0 auto;
}
과 실제 HTML :
<div id="pageMiddle">
<div id="holder">
<div id="searchBar">
<div id="searchwrapper">
<form name="search_input">
I am looking for a
<div id="sBar1" style="display:inline;">
<select id="search_level" class="selectSearchBar" name="search_level">
<?php echo "<option>Level</option>";
while($row = mysqli_fetch_array($result_level, MYSQLI_ASSOC)){
echo "<option value=".$row['id'].">".$row['level']."</option>";
}?>
</select>
</div>
<div id="sBar2" class="selectSearchBar"></div>
<div id="sBar3" class="selectSearchBar"></div>
tutor in
<input type=text class="searchbox" id="location" value="Location"/>
<input type=image src="images/search_icon.png " class="searchbox_submit" name="searchbox_submit" onclick="searchLocations()" value=""></form>
</div>
</div>
</div>
</div>
당신은 당신 폭의 일부에 단위 누락, 값이'margin's에서 0 인 경우는'px' 필요하지 않습니다 –
@TomPietrosanti - 감사합니다 - 그들은 오타하며에서 정확 실제 스크립트 – Mobaz