怎样才能让搜索按钮在搜索框的右面
css:p{padding:12px0;margin:10px;font-size:.8em;line-height:1.5;}form{margin:0;}#searc...
css:
p {
padding: 12px 0;
margin: 10px;
font-size: .8em;
line-height: 1.5;
}
form {
margin:0;
}
#search_box {
width: 789px;
height: 51px;
background:url(img/d_r2_c2.png);
margin-left:130px;
margin-top:70px;
}
#search_box #s {
float: right;
padding: 10px;
margin: 8px 20px 10px 6px;
border: 0;
width: 690px;
background: none;
font-size: .8em;
}
#search_box #go {
float:right;
margin:10px;
}
html:
<div id="search_box">
<form id="search_form" method="post" action="#">
<input type="text" id="s" value="Search" class="swap_value" />
<input type="image" src="img/a_r6_c16.png" width="138" height="48" id="go" alt="Search" title="Search" />
</form>
</div> 展开
p {
padding: 12px 0;
margin: 10px;
font-size: .8em;
line-height: 1.5;
}
form {
margin:0;
}
#search_box {
width: 789px;
height: 51px;
background:url(img/d_r2_c2.png);
margin-left:130px;
margin-top:70px;
}
#search_box #s {
float: right;
padding: 10px;
margin: 8px 20px 10px 6px;
border: 0;
width: 690px;
background: none;
font-size: .8em;
}
#search_box #go {
float:right;
margin:10px;
}
html:
<div id="search_box">
<form id="search_form" method="post" action="#">
<input type="text" id="s" value="Search" class="swap_value" />
<input type="image" src="img/a_r6_c16.png" width="138" height="48" id="go" alt="Search" title="Search" />
</form>
</div> 展开
1个回答
展开全部
p {
padding: 12px 0;
margin: 10px;
font-size: .8em;
line-height: 1.5;
}
form {
margin:0;
}
#search_box {
width: 789px;
height: 51px;
background:url(img/d_r2_c2.png);
margin-left:130px;
margin-top:70px;
}
#search_box #s {
float: left;
padding: 10px;
margin: 8px 20px 10px 6px;
border: 0;
width: 690px;
background: none;
font-size: .8em;
}
#search_box #go {
float:left;
margin:10px;
}
html:
<div id="search_box">
<form id="search_form" method="post" action="#">
<input type="text" id="s" value="Search" class="swap_value" />
<input type="image" src="img/a_r6_c16.png" width="138" height="48" id="go" alt="Search" title="Search" />
</form>
</div>
那是因为你的搜索框过长,你外围div并没有设置宽度,外围div的宽度等搜索框的宽度加按钮的宽度,再加Margin的宽度就可以了
padding: 12px 0;
margin: 10px;
font-size: .8em;
line-height: 1.5;
}
form {
margin:0;
}
#search_box {
width: 789px;
height: 51px;
background:url(img/d_r2_c2.png);
margin-left:130px;
margin-top:70px;
}
#search_box #s {
float: left;
padding: 10px;
margin: 8px 20px 10px 6px;
border: 0;
width: 690px;
background: none;
font-size: .8em;
}
#search_box #go {
float:left;
margin:10px;
}
html:
<div id="search_box">
<form id="search_form" method="post" action="#">
<input type="text" id="s" value="Search" class="swap_value" />
<input type="image" src="img/a_r6_c16.png" width="138" height="48" id="go" alt="Search" title="Search" />
</form>
</div>
那是因为你的搜索框过长,你外围div并没有设置宽度,外围div的宽度等搜索框的宽度加按钮的宽度,再加Margin的宽度就可以了
追问
已经解决了 O(∩_∩)O谢谢
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询