HTML+CSS作品展⽰(仿写京东移动端⾸页①)参考来源:
总结:
1.技术选型:单独制作移动端页⾯⽅案,流式布局
2.搭建项⽬结构
3.设置视⼝标签及引⼊初始化样式:normalize.css,index.css,<meta ...>
3.具体布局:⼆倍精灵图(整体缩放,再测量具体位置,左移上移为负),搜索栏(固定定位 fixed),品牌⽇(去除图⽚顶部缝隙,图⽚左上及右上圆⾓),快报(第2、3张图⽚加左边框)
⽹页如下:
⽹页代码如下:
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>jdH5</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<section class="app">
<div class="close">
<img src="images/close.png" alt="">
</div>
<div class="logo">
<img src="images/logo.png" alt="">
</div>
<div class="open1">打开京东App,购物更轻松</div>
<div class="open2">⽴即打开</div>
</section>
<header class="search">
<div class="list">
<img src="images/list.png" alt="">
</div>
<div class="sou">
<div class="left-jd"></div>
<div class="left-icon"></div>
<form action="">
<input class="sousuo" type="text" placeholder="键盘⿏标套装">
</form>
</div>
<div class="login"><span>登录</span></div>
</header>
二郎神是什么<section class="maincontent">
<img src="images/nianhuo2.png" alt="">
<img src="images/nianhuo3.png" alt="">
</div>
</section>
<div class="mainnav">
<ul>
<li>
<img src="images/nav1.png" alt="">
ospf协议使用的算法是
<h4>京东超市</h4>
</li>
<li><img src="images/nav2.png" alt="">
<h4>京东超市</h4>
</li>
<li><img src="images/nav3.png" alt="">
<h4>京东超市</h4>
</li>
<li><img src="images/nav4.png" alt="">
<h4>京东超市</h4>
</li>
<li><img src="images/nav5.png" alt="">
<h4>京东超市</h4>
</li>
<li><img src="images/nav6.png" alt="">
<h4>京东超市</h4>
</li>
<li><img src="images/nav7.png" alt="">
<h4>京东超市</h4>
</li>
<li><img src="images/nav8.png" alt="">
<h4>京东超市</h4>
</li>
<li><img src="images/nav9.png" alt="">
<h4>京东超市</h4>
</li>
<li><img src="images/nav10.png" alt="">
<h4>京东超市</h4>
</li>
</ul>
</div>
<div class="ms">
<div class="ms-hd">
<h4>京东秒杀</h4>
<p>18</p>
<img class="ms-dc" src="images/ms-dc.png" alt="">
<p>更多秒杀</p>
<img class="ms-right" src="images/ms-right.png" alt="">        </div>
<div class="ms-bd">
<li><img src="images/ms1.dpg" alt=""><p>¥25</p></li>            <li><img src="images/ms2.dpg" alt=""><p>¥2568</p></li>            <li><img src="images/ms3.dpg" alt=""><p>¥28.8</p></li>            <li><img src="images/ms4.dpg" alt=""><p>¥19.7</p></li>            <li><img src="images/ms5.dpg" alt=""><p>¥420</p></li>            <li><img src="images/ms6.dpg" alt=""><p>¥42.9</p></li>        </div>
</div>
<div class="product">
<div class="p-left">
<img src="upload/product1.webp" alt="">
<h4>京东商品1</h4>
<h4>京东商品2</h4>
<p class="price">¥99.90</p>
</div>
</div>
<footer>
<ul>
<li><a>⾸页</a></li>
<li><a>分类</a></li>
<li><a>京喜</a></li>
<li><a>购物车</a></li>
<li><a>未登录</a></li>
</ul>
</footer>
</body>
</html>
CSS:
body {
width: 100%;
max-width: 640px;
min-width: 300px;
margin: 0 auto;
padding: 0;
background-color: rgb(199, 197, 197);
font-size: 14px;
font-family: -apple-system,Helvetica,sans-serif;
color: #666;
line-height: 1.5;指针数组和数组指针的区别是啥
}
div {
box-sizing: border-box;
}
input{
box-shadow: none;
border: none;
outline: none;
resize: none;
-webkit-appearance: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.app {
width: 100%;
height: 45px;
line-height: 45px;
text-align: center;
background-color: #333;
}
.close {
float: left;
width: 8%;
height: 45px;
}
.close img {前端html5
width: 10px;
height: 10px;
vertical-align: middle;
}
.logo {
width: 10%;
height: 45px;
}
.logo img {
width: 30px;
height: 30px;
vertical-align: middle;
}
.open1 {
float: left;
width: 57%;
height: 45px;
font-size: 14px;
color: #fff;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;    white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.open2 {
float: left;
width: 25%;
height: 45px;
font-size: 14px;
color: #fff;
background-color: #F63515;
}
.search {
position: sticky;
top: 0;
width: 100%;
max-width: 640px;
min-width: 300px;
background: rgb(195,12,14);
vertical-align: middle;
}
.list {
position: absolute;
top: 0;
left: 0;
width: 40px;
height: 44px;
}
.
list img {
display: block;
margin: 14px 0 0 15px;
width: 20px;
height: 18px;
background: url(../images/list.png) no-repeat;
background-size: 100% 100%;
}
.sou {
position: relative;
height: 44px;
line-height: 44px;
margin: 0 50px;
}
.sousuo {
box-sizing: border-box;
scanf用法视频教程
text-overflow: ellipsis;
padding-left: 65px;
padding-right: 14px;
line-height: 44px;
font-size: 12px;
color: #232326;
border-radius: 15px;
}
.left-jd {
position: absolute;
top: 15px;
left: 10px;
width: 20px;
height: 15px;
background: url(../images/left-jd.png) no-repeat;
background-size: 20px 15px;
}
.
left-jd::after {
content: '';
display: block;
position: absolute;
top: 0;
right: -6px;
height: 15px;
width: 1px;
background-color: #ccc;
}
.left-icon {
position: absolute;
top: 15px;
left: 40px;
width: 18px;
height: 15px;
background: url(../images/jd-sprites.png) -80px 0 no-repeat;    background-size: 200px auto;
}
.login {
position: absolute;
top: 0;
right: 0;
width: 40px;
height: 44px;
line-height: 44px;
font-size: 14px;
color: #fff;
}
.maincontent {
background-color: rgb(195,12,14);
}
.banner img {
width: 100%;
}
.nianhuo {
height: 130px;
}
.nianhuo img:nth-child(1) {
float: left;
height: 100%;
width: 30%;
}
.nianhuo img:nth-child(2) {
float: left;
height: 100%;
html个人网页完整代码图片
width: 40%;
}
.nianhuo img:nth-child(3) {

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。