<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin: 0px;
padding: 0px;
}
.search{
width: 30%;
margin: 100px auto;
display: flex;
height: 40px;
}
.search input{
flex: 4;
outline: none;
border: 2px solid #1974e7;
/* 内边距 和 边框 的值被包含在已经设定好的宽度和高度中 */
box-sizing: border-box;
padding-left: 10px;
}
.search button{
flex: 1;
/* 边框样式 */
border-style: none;
outline: none;
color: #ffffff;
background-color: #1974e7;
}
.search button:hover{
font-size: 16px;
}
</style>
</head>
<body>
<div class="search">
<input type="text" name="" id="" value="" placeholder="请输入...">
<button>搜索</button>
</div>
</body>
</html>
HTML+CSS 实现搜索框
最新推荐文章于 2023-01-20 15:22:37 发布