当一个容器处于“动态”状态时,如何将两个div放置在容器内部?也就是说,content-top-search
中的搜索输入在其中单击时将宽度从226更改为462。中心在容器内定位两个div(一个宽度为动态)
这里是我的CSS代码:
.content-top-buttonsearch-holder {
text-align: center;
float: left;
width: 816px;
margin-left: 15px;
}
.content-top-buttons {
height: 31px;
width: 269px;
float: left;
margin-right: 16px;
}
.content-top-search {
height: 31px;
float: left;
}
这里是我的HTML:
<div class="content-top-buttonsearch-holder">
<div class="content-top-buttons">
<a id="all_events_button" href="#" title="Click to show all events happening!"></a>
<a id="all_venues_button" href="#" title="Click to show all venues in our database!"></a>
<a id="event_finder_button" href="#" title="Click to search for events!"></a>
</div>
<div class="content-top-search">
<input name="venue-search" class="searchbox" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'sort parties by venue name':this.value;" value="sort parties by venue name" />
</div>
</div>
你能给我们你的html吗?我们也需要知道哪些div应该居中。否则这里这是没用的 – Anonymous
我认为你会遇到漂浮物的问题; – HerrSerker
当然,给我第二个 – pufAmuf