rem移动端布局,为什么中间的搜索框会被右边的盒子覆盖掉啊😭。
<!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,user-scalable=no,maximum-scale=1.0,minimum-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<div class="search-content">
<a href="#" class="classify"></a>
<div class="search">
<form action="">
<input type="text" value="厨卫保暖季,哒哒哒" />
</form>
</div>
<a href="#" class="login">登录</a>
</div>
</body>
</html>
@import "common";
body {
min-width: 320px;
width: 15rem;
margin: 0 auto;
line-height: 1.5;
font-family: Arial, Helvetica;
background: #F2F2F2;
}
@baseFont: 50;
.search-content {
display: flex;
position: fixed;
left: 50%;
top: 0;
transform: translateX(-50%);
width: 15rem;
height: (88rem / @baseFont);
margin: 0 auto;
background-color: #FFC001;
.classify {
width: (44rem / @baseFont);
height: (70rem / @baseFont);
background-color: pink;
margin: (11rem / @baseFont) (25rem / @baseFont) (7rem / @baseFont) (24rem / @baseFont);
background: url(../images/classify.png) no-repeat;
background-size: (44rem / @baseFont) (70rem / @baseFont);
}
.search {
flex: 1;
input {
height: (66rem / @baseFont);
width: 100%;
border: 0;
outline: none;
margin-top: (12rem / @baseFont);
padding-left: (55rem / @baseFont);
border-radius: (33rem / @baseFont);
font-size: (25rem / @baseFont);
background-color: #FFF2CC;
color: #999;
}
}
.login {
width: (75rem / @baseFont);
height: (70rem / @baseFont);
background-color: purple;
padding: (10rem / @baseFont);
font-size: (25rem / @baseFont);
line-height: (70rem / @baseFont);
text-align: center;
color: #fff;
}
}