我有一个4个搜索引擎可以选择的起始页。选择搜索引擎时,如何使每个字段都被选中?
这是其中一个引擎:
<div id="searchrotate" class="body">
<div class="tab_container">
<div id="Bing" class="tab_content"><!-- Bing -->
<div class="searchform">
<form method="get" action="http://www.bing.com/search" name="bing-search">
<div class="favicon"><img src="images/favicon-bing.jpg"></div>
<input type="text" name="q" class="searchfield" value="">
<input type="image" src="images/search-btn.jpg" class="searchbtn" alt="Submit">
</form>
</div>
</div>...and 4个选项之间“旋转”的css:
#searchhold { width:360px; height:62px; }
#searchselect { width:360px; height:26px; }
#searchselect ul { margin:0; padding:0; float: left; list-style:none; }
#searchselect ul li { float:left; overflow: hidden; position: relative; }
#searchselect ul li.current { color:#000; font-weight:bold; background:#ccc; background: -moz-linear-gradient(top, #FFFFFF 0%, #CFCFCF 100%); /* firefox */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFFFFF), color-stop(100%,#CFCFCF)); /* webkit */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#CFCFCF',GradientType=0 ); /* ie */ }
#searchselect ul li.current a { color:#000; }
#searchselect ul li a { display:block; width:68px; height:14px; padding:6px; text-align:center; color:#fff; text-decoration:none; }
#searchrotate { width:360px; height:36px; background: #cfcfcf; background: -moz-linear-gradient(top, #FFFFFF 0%, #E4E4E4 50%, #CFCFCF 51%, #D9D9D9 100%); /* firefox */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFFFFF), color-stop(50%,#E4E4E4), color-stop(51%,#CFCFCF), color-stop(100%,#D9D9D9)); /* webkit */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#D9D9D9',GradientType=0 ); /* ie */ }
#searchrotate div.searchform { width:350px; height:26px; padding:5px; }
#searchrotate div.searchform div.favicon { float:left; display:block; width:27px; height:27px; }
#searchrotate input.searchfield { float:left; display:block; width:266px; height:15px; padding:5px; border:1px solid #b0b0b0; background:#535353; color:#fff; font-size:11px; }
#searchrotate input.searchbtn { float:right; display:block; width:44px; height:27px; border:none; background:#a8a8a8; }发布于 2011-01-28 10:30:53
如下所示:
<div id="clickme" onclick="document.getElementById('bing').focus()">This can be any element</div>
<input type="text" id="bing"/>如果你点击"clickme“div,必应输入栏将被选中。您可以对几乎任何类型的元素(input、div、span等)执行此操作,并且它们可以位于文档的任何位置。
https://stackoverflow.com/questions/4824192
复制相似问题