第一步制作导航栏
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>mi商城</title>
<style>
*{
margin: 0;
padding:0;
}
.box{
height: 40px;
background: rgb(51,51,51);
}
.box .nav{
height: 40px;
width: 1240px;
margin: auto;
}
.box .nav .left{
float: left;
}
.box .nav .right{
float: right;
}
.left li {
float: left;
list-style-type: none;
line-height: 40px;
margin-left: 20px;
color: white;
}
.right li{
float: right;
list-style-type: none;
line-height: 40px;
margin-right: 20px;
color: white;
}
</style>
</head>
<body>
<div class="box">
<div class="nav">
<ul class="left">
<li>小米商城</li>
<li>MIUI</li>
<li>IoT</li>
<li>云服务</li>
<li>金融</li>
<li>有品</li>
<li>小爱开放平台</li>
<li>企业团购</li>
</ul>
<ul class="right">
<li>资质证照</li>
<li>协议规则</li>
<li>下载app</li>
<li>Select Location</li>
</ul>
</div>
</div>
</body>
</html>
第二步图片浮动
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>手机</title>
<style>
*{
margin: 0px;
padding: 0px;
}
body{
background:rgb(245,245,245) ;
}
.box{
text-align: center;
width: 230px;
height: 300px;
background: white;
float: left;
margin-left: 15px;
border-radius: 5px;
margin-top: 5px;
}
.box .img{
margin: 8px auto;
width: 200px;
height: 200px;
}
.box .text1{
font-size: 15px;
}
.box .text2{
font-size: 12px;
margin-top: 3px;
color:rgb(194,194,194);
}
.box .text3{
font-size: 13px;
margin-top: 5px;
color: