欢迎访问我的博客,目前从事Machine Learning,欢迎交流

模拟搜索框,让按钮与输入框同行,并解决间隙问题

参考:

https://blog.csdn.net/realDE/article/details/74278050

https://blog.csdn.net/liaobc/article/details/6137770

 

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>调试</title>
  <style>

    .btn-group{
          display:inline-block;
          position: relative;
          vertical-align:middle;
          border:5px solid #ccc;
        }

        .btn-group input,.btn-group button{
          padding:0;
          margin:0;
        }
        .btn-group .input{
          display:inline-block;
          height:30px;
          float:left;
          border:none;
          outline:none;
        }
        .btn-group .btn{
          display:inline-block;
          font-size:15px;
          height:30px;
          float:left
        }


    </style>
</head>

<body>
  <div class="btn-group">
    <input class="input" type="text">
    <button class="btn" type="button" name="button">按钮</button>
  </div>

</body>

</html>

 

posted @ 2018-11-02 09:35  有蚊子  阅读(1064)  评论(0编辑  收藏  举报