当前位置:网站首页>flex布局 (实战小米官网)
flex布局 (实战小米官网)
2022-07-27 08:54:00 【战斗中的老段】
1、小米官网地址
小米官网
2、小米官网原效果图
3、实现效果图
4、代码实现
<!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>Document</title>
<style>
.banner{
width: 1226px;
/* 上下边距 */
margin: 14px auto;
height: 170px;
display: flex;
/* 均匀排列每个元素首个元素放置于起点,末尾元素放置于终点 */
justify-content: space-between;
}
.iconList{
width: 234px;
height: 170px;
display: flex;
/* 换行 */
flex-wrap: wrap;
}
/* 设置宽高 */
.bannerImag{
width: 316px;
height: 170px;
}
/* 图片100% */
.bannerImag>img{
width: 100%;
height: 100%;
}
.iconItem{
width: 33.33%;
height: 50%;
display: flex;
/* 上下垂直 灵活的项目将垂直显示,正如一个列一样。 */
flex-direction: column;
background-color: #5F5750;
/* 主轴居中 居中排列*/
justify-content: center;
/* 元素位于容器的中心。 */
align-items: center;
/* 相对定位 */
position: relative;
}
.iconItem .text{
color: #999;
font-size: 12px;
}
.iconItem>.icon img{
width: 24px;
height: 24px;
/* background-image: url(./img/ls1.png); */
/* 包含 */
background-size: contain;
/* 图片不重复 */
background-repeat: no-repeat;
/* 图片透明度 鼠标放上去亮起来 */
opacity: 0.5;
/* 文字与图表边距 */
margin-bottom: 4px;
}
/* 鼠标移上去显示亮度 */
.iconItem>.icon img:hover{
width: 36px;
height: 36px;
opacity: 1;
}
.iconItem>.text:hover{
color: red;
font-size: 16px;
}
/* :before 选择器向选定的元素前插入内容。
使用content 属性来指定要插入的内容。 */
.h::before{
content: '';
/* 设置块元素才能设置宽高 */
display: block;
width: 88%;
height: 1px;
background-color: #757575;
position: absolute;
bottom: 0;
}
/* :after 选择器向选定元素的最后子元素后面插入内容。
使用content 属性来指定要插入的内容。 */
.v::after{
content: '';
/* 设置块元素才能设置宽高 */
display: block;
width: 1px;
height: 88%;
background-color: #757575;
position: absolute;
right: 0;
}
</style>
</head>
<body>
<!-- 最外层 大盒子 -->
<div class="banner">
<!-- 左边大盒子 -->
<div class="iconList">
<!-- 左边盒子里边 内容和图标 -->
<div class="iconItem h v">
<div class="icon">
<img src="./img/ls1.png" alt="">
</div>
<div class="text">保障服务</div>
</div>
<div class="iconItem h v">
<div class="icon">
<img src="./img/ls2.png" alt="">
</div>
<div class="text">企业团购</div>
</div>
<div class="iconItem h">
<div class="icon">
<img src="./img/ls3.png" alt="">
</div>
<div class="text">F码通道</div>
</div>
<div class="iconItem v">
<div class="icon">
<img src="./img/lx1.png" alt="">
</div>
<div class="text">米粉卡</div>
</div>
<div class="iconItem v">
<div class="icon">
<img src="./img/lx2.png" alt="">
</div>
<div class="text">以旧换新</div>
</div>
<div class="iconItem ">
<div class="icon">
<img src="./img/lx3.png" alt="">
</div>
<div class="text">话费充值</div>
</div>
</div>
<!-- 图片 -->
<div class="bannerImag">
<img src="./img/left.jpg" alt="">
</div>
<div class="bannerImag">
<img src="./img/center.jpg" alt="">
</div>
<div class="bannerImag">
<img src="./img/right.jpg" alt="">
</div>
</div>
</body>
</html>
5、图片
6、图标
边栏推荐
- “寻源到结算“与“采购到付款“两者有什么不同或相似之处?
- [interprocess communication IPC] - semaphore learning
- Minio installation and use
- JS detects whether the client software is installed
- The wechat installation package has soared from 0.5m to 260m. Why are our programs getting bigger and bigger?
- [I2C reading mpu6050 of Renesas ra6m4 development board]
- 691. Cube IV
- 【Flutter -- GetX】准备篇
- vscod
- Digital intelligence innovation
猜你喜欢
![2040: [Blue Bridge Cup 2022 preliminary] bamboo cutting (priority queue)](/img/76/512b7fd4db55f9f7d8f5bcb646d9fc.jpg)
2040: [Blue Bridge Cup 2022 preliminary] bamboo cutting (priority queue)

NiO Summary - read and understand the whole NiO process

5G没能拉动行业发展,不仅运营商失望了,手机企业也失望了

Cache consistency and memory barrier

General Administration of Customs: the import of such products is suspended

Network IO summary

NIO总结文——一篇读懂NIO整个流程

NiO example

Minio installation and use

Mmrotate trains its dataset from scratch
随机推荐
5G没能拉动行业发展,不仅运营商失望了,手机企业也失望了
Day3 -- flag state holding, exception handling and request hook
Horse walking oblique sun (backtracking method)
The wechat installation package has soared from 0.5m to 260m. Why are our programs getting bigger and bigger?
tensorflow包tf.keras模块构建和训练深度学习模型
Encountered 7 file(s) that should have been pointers, but weren‘t
Cookie addition, deletion, modification and exception
Day4 --- flask blueprint and rest ful
07_ Service registration and discovery summary
User management - restrictions
[interprocess communication IPC] - semaphore learning
Is online account opening safe? Want to know how securities companies get preferential accounts?
Matlab数据导入--importdata和load函数
Openresty + keepalived 实现负载均衡 + IPV6 验证
4275. Dijkstra序列
Day5 - Flame restful request response and Sqlalchemy Foundation
Do a reptile project by yourself
Interface test tool - JMeter pressure test use
NIO示例
【nonebot2】几个简单的机器人模块(一言+彩虹屁+每日60s)