<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./download/font_4353511_x66hiumitbb/iconfont.css">
<link rel="stylesheet" href="./03-index.css">
</head>
<body>
<div class="top-nav">
<div class="container">
<div class="top-nav-left">
<a href="#">小米官网</a>
<span>|</span>
<a href="#">小米商城</a>
<span>|</span>
<a href="#">小米澎湃OS</a>
<span>|</span>
<a href="#">LOT</a>
<span>|</span>
<a href="#">云服务</a>
<span>|</span>
<a href="#">天星数科</a>
<span>|</span>
<a href="#">有品</a>
<span>|</span>
<a href="#">小爱开放平台</a>
<span>|</span>
<a href="#">资质证照</a>
<span>|</span>
<a href="#">协议规则</a>
<span>|</span>
<a href="#">下载APP</a>
<span>|</span>
<a href="#">Select Location</a>
</div>
<div class="top-nav-right">
<a href="#">登录</a>
<span>|</span>
<a href="#">注册</a>
<span>|</span>
<a href="#">消息通知</a>
<button><em class="iconfont icon-sousuo"></em>购物车(0)</button>
</div>
</div>
</div>
<div class="site-header">
<div class="container">
<div class="site-header-left"></div>
<div class="site-header-center">
<ul>
<li><a href="#">Xiaomi手机</a></li>
<li><a href="#">Redmi手机</a></li>
<li><a href="#">电视</a></li>
<li><a href="#">笔记本</a></li>
<li><a href="#">平板</a></li>
<li><a href="#">家电</a></li>
<li><a href="#">路由器</a></li>
<li><a href="#">服务中心</a></li>
<li><a href="#">社区</a></li>
</ul>
</div>
<div class="site-header-right">
<input type="text">
<button><em class="iconfont icon-sousuo"></em> </button>
</div>
</div>
</div>
<div class="banner">
<div class="container">
<img src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/72d2f359aa032bc5f6372b3022b39a92.jpg?thumb=1&w=1269&h=476&f=webp&q=90"
alt="" width="1226px">
<div class="banner-nav">
<ul>
<li><a href="#">手机<span>></span></a></li>
<li><a href="#">电视<span>></span></a></li>
<li><a href="#">家电<span>></span></a></li>
<li><a href="#">笔记本<span>></span></a></li>
<li><a href="#">出行 穿戴<span>></span></a></li>
<li><a href="#">耳机 音箱<span>></span></a></li>
<li><a href="#">健康 儿童<span>></span></a></li>
<li><a href="#">生活 箱包<span>></span></a></li>
<li><a href="#">智能 路由器<span>></span></a></li>
<li><a href="#">电源 配件<span>></span></a></li>
</ul>
</div>
</div>
</div>
</body>
</html>
弹性盒子(父项变为弹性盒子) | ||
display: flex; | 变成弹性盒子 | |
flex-direction: row-reverse; | 主轴反转 | |
flex-direction: column; | 主轴改为竖主轴 | |
flex-direction: column-reverse; | 竖轴的反转 | |
justify-content: center; | 让弹性盒子居中 | |
justify-content: space-between; | 俩边贴边中间平分剩余空间 | |
justify-content: flex-end; | 让弹性盒子靠最右侧 | |
justify-content: space-around; | 子项平分剩余空间 | |
align-items: center; | 交叉轴对齐(子类选择器)垂直居中 | |
flex布局·(弹性盒子) | 强行将子项挤压在一行(一行八个) | |
flex-wrap: nowrap; | flex布局自动换行(自己把大小调一调) | |
align-content: center; | 交叉轴在中间对齐 | |
align-content: space-between; | 交叉轴靠最上最下俩边(对齐) | |
align-content: flex-start; | 交叉轴在最上方 | |
.four{ | 子项排列顺序 | |
order: -2; | order值越小排列越靠前 | |
} | order值默认值为0 | |
分剩余空间可以不设置宽度按比例分 | ||
flex-grow: 1; | 平分所有 | |
flex-shrink: 0; | 子部分不会被压缩默认值为1 | |
align-self: flex-end; | 子项单独动(最下边) | |
布局 | ||
flex-wrap: nowrap; | ||
flex-wrap: wrap; | 自动换行 | |
justify-content: space-between; | 水平对齐 |