html css input submit按钮和input输入框怎么不对齐,?高度都是一样的
<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>Document</title><style...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
*{margin: 0px;padding: 0px; }
body{font-family: "微软雅黑";font-size: 14px;}
form { border-radius: 5px;-wbkit-border-radius:5px; background-color: white; margin-left: 170px; width:340px;height:45px; }
/*p*/.top-log-mid-search{ display:inline-block;width:70px;background-color: white;text-align: center;height: 30px;}
.top-log-mid-search>em{ display: inline-block;width: 16px;height: 20px; background: url(./img/xiala.png) no-repeat;}
.top-log-mid-input-text{width: 200px; border: none; height: 30px;font-size: 14px; line-height: 30px;outline: none;}
.top-log-mid-search-log { background:url(./img/search-log.png) no-repeat;width:50px;height: 30px;border: 0;}
</style>
</head>
<body bgcolor="pink">
<form method="post" name="search" >
<p class=" top-log-mid-search" >搜商品 <em></em></p>
<input class="top-log-mid-input-text" type="text" placeholder="411美颜节春季大促" >
<input type="submit" class="top-log-mid-search-log" value=""> </input>
</form>
</body>
</html> 展开
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
*{margin: 0px;padding: 0px; }
body{font-family: "微软雅黑";font-size: 14px;}
form { border-radius: 5px;-wbkit-border-radius:5px; background-color: white; margin-left: 170px; width:340px;height:45px; }
/*p*/.top-log-mid-search{ display:inline-block;width:70px;background-color: white;text-align: center;height: 30px;}
.top-log-mid-search>em{ display: inline-block;width: 16px;height: 20px; background: url(./img/xiala.png) no-repeat;}
.top-log-mid-input-text{width: 200px; border: none; height: 30px;font-size: 14px; line-height: 30px;outline: none;}
.top-log-mid-search-log { background:url(./img/search-log.png) no-repeat;width:50px;height: 30px;border: 0;}
</style>
</head>
<body bgcolor="pink">
<form method="post" name="search" >
<p class=" top-log-mid-search" >搜商品 <em></em></p>
<input class="top-log-mid-input-text" type="text" placeholder="411美颜节春季大促" >
<input type="submit" class="top-log-mid-search-log" value=""> </input>
</form>
</body>
</html> 展开
展开全部
这是input的一个小BUG,对齐的话只能用距离上的尺寸,用绝对位置。别忘了给上一层容器元素加一个相对位置布局,不加其他的。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
* {
margin: 0px;
padding: 0px;
}
body {
font-family: "微软雅黑";
font-size: 14px;
}
form {
border-radius: 5px;
-wbkit-border-radius: 5px;
background-color: blue;
margin-left: 170px;
width: 340px;
height: 30px;
padding: 5px 0;
}
.top-log-mid-search,
.top-log-mid-input-text,
.top-log-mid-search-log {
float: left;
display: inline-block;
}
/*p*/
.top-log-mid-search {
width: 70px;
background-color: white;
text-align: center;
height: 30px;
margin: 0 5px 0;
}
.top-log-mid-search>em {
display: inline-block;
width: 16px;
height: 20px;
background: url(./img/xiala.png) no-repeat;
}
.top-log-mid-input-text {
width: 190px;
border: none;
height: 30px;
font-size: 14px;
line-height: 30px;
outline: none;
margin-right: 5px;
padding: 0 5px;
}
.top-log-mid-search-log {
background: url(./img/search-log.png) no-repeat;
width: 50px;
height: 30px;
}
margin: 0px;
padding: 0px;
}
body {
font-family: "微软雅黑";
font-size: 14px;
}
form {
border-radius: 5px;
-wbkit-border-radius: 5px;
background-color: blue;
margin-left: 170px;
width: 340px;
height: 30px;
padding: 5px 0;
}
.top-log-mid-search,
.top-log-mid-input-text,
.top-log-mid-search-log {
float: left;
display: inline-block;
}
/*p*/
.top-log-mid-search {
width: 70px;
background-color: white;
text-align: center;
height: 30px;
margin: 0 5px 0;
}
.top-log-mid-search>em {
display: inline-block;
width: 16px;
height: 20px;
background: url(./img/xiala.png) no-repeat;
}
.top-log-mid-input-text {
width: 190px;
border: none;
height: 30px;
font-size: 14px;
line-height: 30px;
outline: none;
margin-right: 5px;
padding: 0 5px;
}
.top-log-mid-search-log {
background: url(./img/search-log.png) no-repeat;
width: 50px;
height: 30px;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询