<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>搜索框</title>
<style>
* {
padding: 0;
margin: 0;
}
.search {
width: 30%;
margin: 100px auto;
display: flex;
/*border: 1px solid red;*/
}
.search input {
float: left;
/* //左浮动 */
flex: 4;
height: 30px;
outline: none;
border: 1px solid red;
box-sizing: border-box;
/* //盒子模型,怪异IE盒子模型,width=content+border*2+padding*2 */
padding-left: 10px;
}
.search button {
float: right;
flex: 1;
height: 30px;
background-color: red;
color: white;
border-style: none;
outline: none;
}
.search button i {
font-style: normal;
}
.search button:hover {
font-size: 16px;
}
</style>
</head>
<body>
<div class="search">
<input type="text" placeholder="请输入..." name="" id="" value="" />
<button><i>搜索</i></button>
</div>
<p>1</p>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
</head>
<body>
<div class="parent blue">
<div class="son red"contenteditable ></div>
</div>
</body>
<style>
/* 超级居中 */
.parent {
/* background-color: aqua; */
width: 100%;
height: 1000px;
}
.parent{
display: grid;
place-items: center;
}
.son {
background-color: red;
height: 200px;
width: 600px;
}
</style>
</html>