弹性盒flex的使用
程序员文章站
2022-03-13 13:56:28
...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>伸缩盒</title>
<style>
header{
min-width: 1200px;
height: 100px;
display: flex;
align-items: center;
justify-content: space-around;
}
.logo{
height: 100%;
width: 200px;
background: url("https://www.php.cn/static/images/PHPlogo.png") no-repeat;
background-size: cover;
}
.nav{
width: 800px;
display: flex;
justify-content: space-between;
}
.info{
width: 100px;
display: flex;
align-items: center;
justify-content: space-between;
}
.head_img{
width: 50px;
height: 50px;
background: cornflowerblue;
border-radius: 50%;
line-height: 50px;
text-align: center;
color: #FF0000;
}
</style>
</head>
<body>
<header>
<div class="logo"></div>
<div class="nav">
<div class="nav_item">首页</div>
<div class="nav_item">视频教程</div>
<div class="nav_item">学习路径</div>
<div class="nav_item">大前端</div>
<div class="nav_item">资源下载</div>
<div class="nav_item">技术文章</div>
<div class="nav_item">社区</div>
</div>
<div class="info">
<div class="msg">消息</div>
<div class="head_img">头像</div>
</div>
</header>
</body>
</html>
上一篇: Vue:怎么设置,不让eslint报错
下一篇: 商城HTML所有页面