苏宁易购自适应屏幕移动端

12 篇文章 0 订阅
8 篇文章 0 订阅

 

                   

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, user-scalable=0, maximum-scale=1.0" />
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/index.css">
    <title>苏宁易购</title>
    <link rel="shortcut icon" href=" favicon.ico" />

</head>

<body>
    <!-- 顶部搜索框 -->
    <div class="search-content">
        <a href="#" class="classify"></a>
        <div class="search">
            <input type="search" placeholder="厨卫保季暖">
        </div>
        <div class="login">登录</div>
    </div>
    <!-- 广告部分 -->
    <div class="banner">
        <img src="upload/banner.gif" alt="">
    </div>
    <div class="ad">
        <a href="#">
            <img src="upload/ad1.gif" alt="">
        </a>
        <a href="#">
            <img src="upload/ad2.gif" alt="">
        </a>
        <a href="#">
            <img src="upload/ad3.gif" alt="">
        </a>
    </div>
    <!-- nav模块 -->
    <nav>
        <a href="#">
            <img src="upload/nav1.png" alt="">
            <span>
                苏宁秒杀
            </span>
        </a>
        <a href="#">
            <img src="upload/nav2.png" alt="">
            <span>
                苏宁超市
            </span>
        </a>
        <a href="#">
            <img src="upload/nav3.png" alt="">
            <span>
                苏宁拼购
            </span>
        </a>
        <a href="#">
            <img src="upload/nav4.png" alt="">
            <span>
                手机数码
            </span>
        </a>
        <a href="#">
            <img src="upload/nav5.png" alt="">
            <span>
                苏宁家电
            </span>
        </a>
        <a href="#">
            <img src="upload/nav6.png" alt="">
            <span>
                免费水果
            </span>
        </a>
        <a href="#">
            <img src="upload/nav7.png" alt="">
            <span>
                super会员
            </span>
        </a>
        <a href="#">
            <img src="upload/nav8.png" alt="">
            <span>
                签到有礼
            </span>
        </a>
        <a href="#">
            <img src="upload/nav9.png" alt="">
            <span>
                领券中心
            </span>
        </a>
        <a href="#">
            <img src="upload/nav10.png" alt="">
            <span>
                更多频道
            </span>
        </a>
    </nav>
    <!-- bottom模块 -->
    <div class="bottom">
        <div class="row">
            <a href="#">
                <img src="upload/bot1.jpg" alt="">
            </a>
            <a href="#">
                <img src="upload/bot2.jpg" alt="">

            </a>
        </div>
        <div class="row">
            <a href="#">
                <img src="upload/bot3.jpg" alt="">
            </a>
            <a href="#">
                <img src="upload/bot4.jpg" alt="">

            </a>
        </div>
        <div class="row">
            <a href="#">
                <img src="upload/bot5.jpg" alt="">
            </a>
        </div>
    </div>
</body>

</html>

css代码

html {
  font-size: 50px;
}
@media screen and (min-width: 320px) {
  html {
    font-size: 21.33333333px;
  }
}
@media screen and (min-width: 360px) {
  html {
    font-size: 24px;
  }
}
@media screen and (min-width: 375px) {
  html {
    font-size: 25px;
  }
}
@media screen and (min-width: 384px) {
  html {
    font-size: 25.6px;
  }
}
@media screen and (min-width: 400px) {
  html {
    font-size: 26.66666667px;
  }
}
@media screen and (min-width: 414px) {
  html {
    font-size: 27.6px;
  }
}
@media screen and (min-width: 424px) {
  html {
    font-size: 28.26666667px;
  }
}
@media screen and (min-width: 480px) {
  html {
    font-size: 32px;
  }
}
@media screen and (min-width: 540px) {
  html {
    font-size: 36px;
  }
}
@media screen and (min-width: 720px) {
  html {
    font-size: 48px;
  }
}
@media screen and (min-width: 750px) {
  html {
    font-size: 50px;
  }
}
img {
  vertical-align: middle;
}
a {
  text-decoration: none;
}
body {
  min-width: 320px;
  width: 15rem;
  margin: 0 auto;
  line-height: 1.5;
  font-family: Arial, Helvetica;
  background-color: #f2f2f2;
  font-size: 25px;
  height: 2000px;
}
.search-content {
  position: fixed;
  display: flex;
  left: 0;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 15rem;
  height: 1.76rem;
  background-color: #ffc001;
  align-items: center;
}
.search-content .classify {
  width: 0.88rem;
  height: 1.4rem;
  background: url(../images/classify.png) no-repeat;
  background-size: 0.88rem;
  margin: 0 0.4rem;
}
.search-content .login {
  width: 1.5rem;
  height: 1.4rem;
  margin: 0 0.2rem;
  color: #fff;
  font-size: 0.5rem;
  text-align: center;
  line-height: 1.4rem;
}
.search-content .search {
  flex: 1;
}
.search-content .search input {
  width: 11.24rem;
  height: 1.32rem;
  border-radius: 1.32rem;
  border: 0;
  padding: 0 1rem;
  background-color: #fff2cc;
  color: #757575;
  font-size: 0.52rem;
  outline: none;
}
.banner {
  width: 15rem;
}
.banner img {
  width: 100%;
}
.ad {
  display: flex;
  width: 15rem;
  margin: 0.1rem 0;
}
.ad a {
  flex: 1;
}
.ad a img {
  width: 100%;
}
nav {
  width: 15rem;
  overflow: hidden;
  background-color: #f6f6f6;
  margin-bottom: 0.4rem;
}
nav a {
  float: left;
  width: 3rem;
  height: 2.8rem;
  color: #333;
  font-size: 0.5rem;
  text-align: center;
}
nav a img {
  display: block;
  width: 1.64rem;
  height: 1.64rem;
  margin: 0.2rem 0.68rem 0.06rem;
}
.bottom {
  width: 15rem;
}
.bottom .row {
  display: flex;
}
.bottom .row a {
  flex: 1;
  box-sizing: border-box;
}
.bottom .row a img {
  width: 100%;
}
.bottom .row:nth-child(-n+2) a:nth-child(1) {
  border-right: 1px solid #ccc;
}
.bottom .row:nth-child(3) a:nth-child(1) {
  border-top: 1px solid #ccc;
}

 

  • 1
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Bubble_Qi

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值