常见搜索 input 浮动中间间隙 ---简单解决方法
原因:inline-block元素之间有如果有换行或者空格就会有间隙
解决方法:再父元素font-size:0; 即可 还有许多其他方法,自行百度吧!
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Web Dojo Code</title> <style> .down_banner{height: 254px;background:red url("../img/down_banner.png") no-repeat scroll center top;font-size:0;} .down_banner p{text-align: center;display: inline-block;width: 100%;font-size: 16px;color: #ffffff;padding-bottom: 20px;padding-top: 125px;} .down_banner form label{display: inline-block;width: 100%;text-align: center} .down_banner form label input[type="text"]{background: #fff;width: 420px;height: 42px;line-height: 42px; text-indent: 25px;border-top-left-radius: 5px;border-bottom-left-radius: 5px;border: 0;font-size: 16px;color: #0d36b6;} .down_banner form label input[type="submit"]{width: 70px;background-color: #0c78ee;border-top-right-radius: 5px;border: 0;border-bottom-right-radius: 5px; color: #fff;font-size: 18px;height: 40px;line-height: 40px;} </style> </head> <body> <div class="down_banner"> <p> 下载中心 </p> <form action=""> <label> <input type="text" placeholder="请输入标题或者关键字进行搜索"> <input type="submit" value="搜索"> </label> </form> </div> </body> </html>
欢迎加入前端技术交流qq群:370200203; : ) 欢迎欢迎!热烈欢迎!