-2
.box {
margin: 10px auto;
width: 100%;
height: 50px;
}
.container {
width: 900px;
vertical-align: middle;
white-space: nowrap;
position: relative;
float: left;
}
input#cat,
input#search {
height: 50px;
border: 1 solid #2b303b;
font-size: 10pt;
float: left;
}
.box1 .container-1 input#cat {
width: 25%;
}
.box1 input#search {
width: 75%;
}
.box2 .container-1 input#cat {
width: 25%;
}
.box2 .container-2 input#cat {
width: 25%;
}
.box2 input#search {
width: 50%;
}
.box3 .container-1 input#cat {
width: 25%;
}
.box3 .container-2 input#cat {
width: 25%;
}
.box3 .container-3 input#cat {
width: 25%;
}
.box3 input#search {
width: 25%;
}
<div class="container">
<h2>Senario 1</h2>
<div class="box box1">
<div class="container-1">
<input type="cat" id="cat" placeholder="Parent Category (A)">
</div>
<div class="container-2">
<input type="search" id="search" placeholder="Search...">
</div>
</div>
<h2>Senario 2</h2>
<div class="box box2">
<div class="container-1">
<input type="cat" id="cat" placeholder="Parent Category (A)">
</div>
<div class="container-2">
<input type="cat" id="cat" placeholder="Sub-Category (B) of A">
</div>
<div class="container-3">
<input type="search" id="search" placeholder="Search...">
</div>
</div>
<h2>Senario 3</h2>
<div class="box box3">
<div class="container-1">
<input type="cat" id="cat" placeholder="Parent Category (A)">
</div>
<div class="container-2">
<input type="cat" id="cat" placeholder="Sub-Category (B) of A">
</div>
<div class="container-3">
<input type="cat" id="cat" placeholder="Sub-Category (C) of B">
</div>
<div class="container-4">
<input type="search" id="search" placeholder="Search...">
</div>
</div>
</div>
我定製了DJ公告高級搜索模塊中的這樣一種方式,一類家長和孩子都在網上與搜索輸入框。我設置類別的div和搜索輸入靜態。有什麼方法可以在添加兒童類別時使其可調整大小(請參見圖片)。 HTML和CSS
沒有人會幫你,如果你不張貼你的代碼,你試過。 –