新手求助,为什么提交按钮调成和背景图片一样大小,仍然会超出背景。

qq_40227380 2017-09-14 04:55:27

<div class="logos">
<div class="logo">
<h1><a href="page.html"><img src="images/logo.jpg"></a></h1>
</div>
<div class="sousuo">
<form action="page.html" method="get">
<table cellspacing="0">
<tr>
<td class="s_z"></td>
<td class="s_c">
<input type="text" name="text">
</td>
<td class="s_y">
<button type="submit" name="submit"></button>
</td>
</tr>
</table>
</form>
</div>
</div>

.sousuo {
width: 350px;
height: 41px;
margin-top: 8px;
float: left

}
.sousuo td{
height: 41px;

}

.s_z{
width: 6px;
background: url(images/s_l.jpg) no-repeat;

}
.s_c{
width: 240px;
background: url(images/s_c.jpg);

}
.s_y{
width: 78px;
background: url(images/s_r.jpg);
}
input{
width: 242px;
height: 38px;
border: 0
}
button{
width: 78px;
height: 41px;
background: 0;
border: 0
}


...全文
432 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
csdnwjj 2017-10-05
  • 打赏
  • 举报
回复
background-size:contain或者cover
qq_40227380 2017-09-22
  • 打赏
  • 举报
回复
跪求帮忙看看
看着是个昵称 2017-09-22
  • 打赏
  • 举报
回复
没有设置背景图的大小
apple8160 2017-09-22
  • 打赏
  • 举报
回复
你把背景图设置到button上去
pengxiaoshuang0 2017-09-15
  • 打赏
  • 举报
回复
在 <img src="images/logo.jpg" Width="100" Height="50"> 神仙也变不大
ddcatlee 2017-09-15
  • 打赏
  • 举报
回复
试试: td {vertical-align: top;}
qq_40227380 2017-09-15
  • 打赏
  • 举报
回复
感谢解答。但是我设置过了,开头就设置了 *{margin="0";padding="0"},没截出来,怕太长看了眼花。并且我在chrome也检查了,padding和margin值都是0。
天际的海浪 2017-09-14
  • 打赏
  • 举报
回复
元素都设置 padding: 0px; margin: 0px;

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧