为什么搜索按钮上始终有一条缝隙 这是什么原因 怎么解决?

img

<div class="search">
      <input type="search" name="" id="" placeholder="输入关键字">
      <button type="submit">搜索</button>
</div>
.search {
    position: absolute;
    left: 346px;
    top: 25px;
    width: 538px;
    height: 36px;
    border: 2px solid #6719b1;
}
.search input {
    display: block;
    width: 454px;
    height: 32px;
    padding-left: 10px;
}
.search button {
    border:none;
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 32px;
    line-height: 32px;
    background-color: #6719b1;
    font-size: 16px;
    color: #fff;
}

input 和 button 的高度设置成与div的height: 36px;一样即可
并且input也设置 border:none;
如有帮助,望采纳!谢谢! 点击我这个回答右上方的【采纳】按钮

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title> 页面名称 </title>
<style type="text/css">
.search {
    position: absolute;
    left: 346px;
    top: 25px;
    width: 538px;
    height: 36px;
    border: 2px solid #6719b1;
}
.search input {
    display: block;
    width: 454px;
    height: 36px;
    border:none;
    padding-left: 10px;
}
.search button {
    border:none;
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 36px;
    line-height: 32px;
    background-color: #6719b1;
    font-size: 16px;
    color: #fff;
}

</style>
</head>
<body>
<div class="search">
      <input type="search" name="" id="" placeholder="输入关键字">
      <button type="submit">搜索</button>
</div>
</body>
</html>

img

css样式的问题,
height: 32px;
设置为
height: 34px;
试试。