【发布时间】:2014-03-07 14:02:53
【问题描述】:
我需要一点帮助来让我的搜索框响应
HTML:
<div class="span12">
<div id='search-box'>
<form action='/search' id='search-form' method='get' target='_top'>
<input class='search-text' name='q' placeholder='Search by name' type='text'/>
<button id='search-button' type='submit'>src</button>
</form>
</div>
</div>
CSS:
#search-box {
width:100%;
height:44px;
background:#ffd965;
border-bottom:1px solid #fff;
display:block;
}
#search-form {
positoin:absolute;
left:16px;
right:16px;
width:100%;
height:30px;
background-color:#fff;
display:block;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}
#search-text {
width:100%;
height:25px;
background: transparent;
}
#search-box input[type="text"] {
}
#search-button {
position: absolute;
top: 0;
left: 15px;
height: 42px;
width: 30px;
text-align: center;
border-width: 0;
background-color: transparent ;
background-image:url('../images/search.png');
background-repeat:no-repeat;
}
我的代码是:JSFiddle
【问题讨论】:
-
使用 MediaQueries。您是开发人员吗?设计师?
-
您应该详细说明您正在寻找的行为。
-
我尝试上传图片,但据说您至少需要 10 个赞才能上传图片。:@Shannon
-
我也需要它,因为我们可以在移动设备中看到搜索框,是的,这将是移动应用程序的搜索框。 @香农
-
但首先需要修复全宽:当我们将其设为 100% 时,它会脱离 div 格式。
标签: css html responsive-design fluid-layout