1.小米布局大概
![](https://i-blog.csdnimg.cn/blog_migrate/5083afcbc1720b9c15efa7ed71b0cc13.png)
html:
<!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="./小米布局大概.css">
</head>
<body>
<div class="goods">
<div class="left"></div>
<div class="right">
<ul>
<li>
<a href="#">
<img src="https://cdn.cnbj1.fds.api.mi-img.com/nr-pub/202305241112_ecb14876904f09f3cbc605350a02eff0.png?thumb=1&w=250&h=250&f=webp&q=90" alt="" width="160px" height="160px">
<h3>Xiaomi Civi 3</h3>
<p>仿生双眸 天生双色</p>
<div>2499元起</div>
</a>
</li>
<li>
<a href="#">
<img src="https://cdn.cnbj1.fds.api.mi-img.com/nr-pub/202305241112_ecb14876904f09f3cbc605350a02eff0.png?thumb=1&w=250&h=250&f=webp&q=90" alt="" width="160px" height="160px">
<h3>Xiaomi Civi 3</h3>
<p>仿生双眸 天生双色</p>
<div>2499元起</div>
</a>
</li>
<li>
<a href="#">
<img src="https://cdn.cnbj1.fds.api.mi-img.com/nr-pub/202305241112_ecb14876904f09f3cbc605350a02eff0.png?thumb=1&w=250&h=250&f=webp&q=90" alt="" width="160px" height="160px">
<h3>Xiaomi Civi 3</h3>
<p>仿生双眸 天生双色</p>
<div>2499元起</div>
</a>
</li>
<li>
<a href="#">
<img src="https://cdn.cnbj1.fds.api.mi-img.com/nr-pub/202305241112_ecb14876904f09f3cbc605350a02eff0.png?thumb=1&w=250&h=250&f=webp&q=90" alt="" width="160px" height="160px">
<h3>Xiaomi Civi 3</h3>
<p>仿生双眸 天生双色</p>
<div>2499元起</div>
</a>
</li>
<li>
<a href="#">
<img src="https://cdn.cnbj1.fds.api.mi-img.com/nr-pub/202305241112_ecb14876904f09f3cbc605350a02eff0.png?thumb=1&w=250&h=250&f=webp&q=90" alt="" width="160px" height="160px">
<h3>Xiaomi Civi 3</h3>
<p>仿生双眸 天生双色</p>
<div>2499元起</div>
</a>
</li>
<li>
<a href="#">
<img src="https://cdn.cnbj1.fds.api.mi-img.com/nr-pub/202305241112_ecb14876904f09f3cbc605350a02eff0.png?thumb=1&w=250&h=250&f=webp&q=90" alt="" width="160px" height="160px">
<h3>Xiaomi Civi 3</h3>
<p>仿生双眸 天生双色</p>
<div>2499元起</div>
</a>
</li>
<li>
<a href="#">
<img src="https://cdn.cnbj1.fds.api.mi-img.com/nr-pub/202305241112_ecb14876904f09f3cbc605350a02eff0.png?thumb=1&w=250&h=250&f=webp&q=90" alt="" width="160px" height="160px">
<h3>Xiaomi Civi 3</h3>
<p>仿生双眸 天生双色</p>
<div>2499元起</div>
</a>
</li>
<li>
<a href="#">
<img src="https://cdn.cnbj1.fds.api.mi-img.com/nr-pub/202305241112_ecb14876904f09f3cbc605350a02eff0.png?thumb=1&w=250&h=250&f=webp&q=90" alt="" width="160px" height="160px">
<h3>Xiaomi Civi 3</h3>
<p>仿生双眸 天生双色</p>
<div>2499元起</div>
</a>
</li>
</ul>
</div>
</div>
</body>
</html>
css:
* {
padding: 0;
margin: 0;
}
a{
text-decoration: none;
}
.goods {
display: flex;
width: 1240px;
height: 600px;
border: 2px solid black;
margin: 0 auto;
}
.left {
margin-right: 20px;
width: 300px;
height: 600px;
background-color: pink;
}
.right ul {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-content: space-between;
width: 990px;
height: 600px;
}
ul li {
list-style: none;
width: 230px;
height: 275px;
background-color: rgb(9, 188, 237);
}
2.小米商城布局大概
![](https://i-blog.csdnimg.cn/blog_migrate/5d97b49611db793ff039f097a440c1fc.png)
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>Document</title>
<link rel="stylesheet" href="./小米商城布局.css">
</head>
<body >
<!-- 上半部分 -->
<div class="head-nav">
<div class="mid">
<div class="logo">
<img src="./图片素材/logo.png" >
</div>
<div class="nav-bar">
<ul type="none">
<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="search">
<input type="text" placeholder="搜索">
<button class="find"></div></button>
</div>
</div>
</div>
<!-- 下半部分 -->
<div class="banner">
<div class="mid">
<div class="banner-img">
<img class="banner-img" src="../images/bg03.jpg">
</div>
<div class="daohang">
<ul type="none">
<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>
<li><a href="#" > 路由器 </a></li>
<li><a href="#" > 服务 </a></li>
<li><a href="#" > 社区 </a></li>
</ul>
</div>
</div>
</div>
</body>
</html>
css:
* {
padding: 0;
margin: 0;
}
a{
text-decoration: none;
}
.mid{
width: 1226px;
margin: 0 auto;
}
.head-nav{
width: 100%;
height: 100px;
background-color: aliceblue;
}
.logo{
width: 55px;
height: 55px;
background-color: orange;
float: left;
margin-top: 22.5px;
overflow: hidden;
}
.nav-bar{
width: 875px;
height: 100px;
line-height: 100px;
float: left;
}
.nav-bar li{
float: left;
}
.nav-bar li a{
color: black;
padding: 0 10px ;
}
.search{
width: 296px;
height: 100px;
float: right;
margin-top: 25px;
}
.search input{
width: 244px;
height: 50px;
float: left;
box-sizing: border-box;
}
.search button{
width: 52px;
height: 50px;
float: right;
}
.banner{
width: 100%;
height: 460px;
}
.banner-img{
width: 100%;
background-color: pink;
}
.daohang{
width: 234px;
height: 420px;
padding: 20px 0;
background-color: aqua;
position: absolute;
left: 0;
top: 0;
}
.banner>.mid{
position: relative;
}
.daohang>ul>li{
height: 42px;
line-height: 42px;
text-align: center;
}