首页 > 其他 > 详细

常见搜索 input 浮动中间间隙 ---简单解决方法

时间:2017-02-07 19:01:46      阅读:244      评论:0      收藏:0      [点我收藏+]

原因: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>

  此处不算什么稀罕事,但是我第一次发现,应该记录一下  哈哈

常见搜索 input 浮动中间间隙 ---简单解决方法

原文:http://www.cnblogs.com/novice-wangqi/p/6375438.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!