HTML/Html-Css/21-flex布局-3.html
2023-05-01 19:37:40 +08:00

62 lines
1.1 KiB
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>flex</title>
<style>
#app {
/* 变flex容器 */
display: flex;
height: 60px;
background-color: lightcoral;
align-items: center;
padding: 0 15px;
}
.input {
width: 100%;
height: 40px;
border-radius: 15px;
background-color: lightgrey;
}
span,
b {
/* 项目的缩放
0: 不缩放
*/
flex-shrink: 0;
margin: 0 15px;
width: 100px;
height: 40px;
text-align: center;
line-height: 40px;
background-color: lightgreen;
}
</style>
</head>
<body>
<div id="app">
<span>logo</span>
<div class="input">
</div>
<b>登陆</b>
</div>
</body>
</html>