慕课手机展示页案例

https://www.cnblogs.com/sandraryan/

这个例子来自mooc某个视频。无利益相关~

本来是一个加了js的很好看的页面。但是由于我太菜了,只写好了静态页面。以后学了js考虑加上。(挖坑)

注释量还可以,所以(●'◡'●)

直接上代码

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>mooc phone</title>
    <link href="https://cdn.bootcss.com/normalize/7.0.0/normalize.css" rel="stylesheet">
    <link rel="stylesheet" href="index.css">
</head>
<body>
    <div class="wrap">
        <header class="header">
            <div class="header_wrap">
                <div class="header_logo">慕课手机</div>
                <nav class="header_nav">
                    <a href="javascript:;">首页</a>
                    <a href="javascript:;">机型</a>
                    <a href="javascript:;">说明</a>
                    <a href="javascript:;">其他产品</a>
                    <a href="javascript:;">立即购买</a>
                </nav>
            </div>   
        </header>
            
        <div class="content">
            <div class="screen1">
                <h2 class="screen1_heading"><b>慕课手机</b>让你的生活更精彩</h2>
                <div class="screen1_phone"></div>
                <div class="screen1_shadow"></div>
            </div>
        
            <div class="screen2">
                <h2>优美的设计,更令人着迷</h2>
                <h3>采用受欢迎的设计,让他更加出色<br>
                    款式小巧,轻便,手感舒适,绚丽高清的显示屏,整个外观格外精致。
                </h3>
                <div class="screen2_phone">
                    <div>高清摄像</div>
                    <div>大屏显示</div>
                    <div>超薄机身</div>
                </div>
            </div>
            <div class="screen3">
                <div class="screen3_wrap">
                    <h2 class="screen3_heading">外形小巧,功能强大的手机</h2>
                    <h3 class="screen3_subheading">采用受欢迎的设计,让它更加出色。
                    <br>款式小巧、轻便手感更舒适。绚丽高清的显示屏,整个外观显得格外精致。</h3>
                    <div class="screen3_phone"></div>
                    <div class="screen3_features">
                    <div><span>5.7</span>英寸大屏</div>
                    <div><span>1200</span>万像素</div>
                    <div><span>3D</span>touch</div>
                    <div><span>A9</span>处理器</div>
                    </div>
                </div>
            </div>

            <div class="screen4">
                <h2>丰富的手机型号</h2>
                <h3>找到适合你的手机</h3>
                <div class="screen4_type">
                    <div>
                        <img src="img/phone-1.png" alt="">
                        <div class="name">慕课红</div>
                        <div class="storage">16G/32G/64G</div>
                    </div>
                    <div>
                        <img src="img/phone-2.png" alt="">
                        <div class="name">土豪金</div>
                        <div class="storage">16G/32G/64G</div>
                    </div>
                    <div>
                        <img src="img/phone-3.png" alt="">
                        <div class="name">太空灰</div>
                        <div class="storage">16G/32G/64G</div>
                    </div>
                    <div>
                        <img src="img/phone-4.png" alt="">
                        <div class="name">绅士黑</div>
                        <div class="storage">16G/32G/64G</div>
                    </div>
                </div>
            </div>

            <div class="screen5">
                <div class="screen-5_wrap">
                    <h2>游戏、学习、拍照、有这一部就够了</h2>
                    <h3>看视频、拍摄高清视频与照片、视频聊天、一机多功能,让您生活更丰富精彩。</h3>
                </div>
                <div class="back"></div>
            </div>
            <div class="buy">
                <a href="javascript:;">立即购买</a>
            </div>
        </div>

        <div class="footer">© 2016 imooc.com 京ICP备13046642号</div>
    </div>
</body>
</html>
* {margin: 0;padding: 0;}
.wrap {
    background-color: #fff;
    font-size: 12px;
    font-family: "Microsoft Yahei",微软雅黑;
}
a {
    text-decoration: none;
}

/* basic style */

/* header start */
.header {
    background-color: #f7f7f7;
}
.header_wrap {
    height: 80px;
    width: 1200px;
    position: relative;
    margin: 0 auto;
    /* 其实我觉得直接写在header里面那就可以 */
}
.header_logo {
    width: 150px;
    height: 38px;
    font-size: 20px;
    color: #07111b;
    text-indent: 50px;
    /* 让logo中文字在图片右侧 */
    background: url(img/logo.png) no-repeat;
    background-position: left center;
    background-size: 38px 38px;
    line-height: 38px;
    position: absolute;
    top: 50%;
    margin-top: -19px;
    left: 20px;
    /* 让整个logo的文字和图片垂直居中 */
}
.header_nav {
    position: absolute;
    right: 20px;
    height: 38px;
    top: 50%;
    margin-top: -19px;
    display: inline-block;
    vertical-align: middle;
    /* header里的nav定位 */
}
.header_nav a{
    color: #292f35;
    font-size: 16px;
    height: 38px;
    line-height: 38px;/* 垂直居中 */
    display: inline-block;
    vertical-align: middle;
    margin-left: 40px;
    /* 拉开距离 */
    cursor: pointer;
}
.header_nav a:hover {
    color: #f01400;
    /* 导航每一项都设置hover字体变红 */
}
.header_nav a:first-child {
    color: #f01400;
    /* 首页默认是激活状态 字体红色 */
    border-bottom: 2px solid red;
}

.header_nav a:last-child{
    background-color: #000;
    color: #f4f4f5;
    text-align: center;
    width: 90px;
    border-radius: 5px;
    /* nav里面最后一个不同的样式 */
}
.header_nav:last-child:hover {
    color: white;
    /* nav里面最后一个hover字体不变红色 因为丑 */
}
/* header end */


/* content start */
.content>div {
    padding: 100px 0 0;
    box-sizing: border-box;
    /* 本来用的是给h2加margin-top,后来遇到了各种各样的margin合并,塌陷问题。 */
    /* 选择用父级padding并加上border-box,避免影响每一屏的定高 */
}

.content>div {
    height: 800px;
    position: relative;
    /* 内容部分几个屏高度相同,都设置为定位父容器 */
}
.screen1 {
    background-color: #e7e7e7;
    background: url(img/bg-screen-1.png) no-repeat center;
    background-size: cover;
    /* 第一屏背景色等基本样式,cover是背景图拉伸填满整个页面 */
    overflow: hidden;
}    
.screen1_heading {
    font-weight: 400;
    margin: 0;padding: 0;
    font-size: 46px;
    color: rgb(245, 245, 245);
    text-align: center;
    /* padding-top: 152px; */
    /* 第一屏的文字样式 */
}
.screen1_heading b {
    color: #f05244;
    font-weight: 400;
    /* 第一屏里特殊样式 */
}
.screen1_phone{
    width: 1365px;
    height: 305px;
    background: url(img/screen-1-phone.png) no-repeat center;
    /* 图片太大了,在父元素overflow */
    position: absolute;
    left: 50%;bottom: 180px;
    margin-left: -687px;
    z-index: 2;
    /* 第一屏手机图片(用背景图),居中,提升层级至阴影图上方 */
}
.screen1_shadow {
    width: 1233px;
    height: 411px;
    background: url(img/screen-1-shadow.png) no-repeat center;
    position: absolute;
    left: 50%;bottom: 30px;
    margin-left: -616px;
    z-index: 1;
    opacity: 0.8;
    /* 第一屏手机阴影图, */
}

.screen2 {
    background-color: #fafafa;
    /* box-sizing: border-box; */
    overflow: hidden;
    /* 第二屏基本样式 */
}
.screen2 h2, .screen4 h2, .screen5 h2{
    font-weight: 400;
    /* padding: 0; */
    color: #f01400;
    text-align: center;
    line-height: 46px;
    /* margin: 100px 0 30px; */
    font-size: 40px;
    /* 第2,4,5屏主要(标题)文字 */
}
.screen2 h3, .screen4 h3, .screen5 h3{
    font-weight: 400;
    margin: 0;padding: 0;
    color: #2c3137;
    text-align: center;
    margin-top: 50px;
    line-height: 28px;
    font-size: 16px;
    /* 第2,4,5屏副标题文字 */
}
.screen2_phone {
    width: 928px;
    height: 873px;
    background: url(img/bg-screen-2.png) no-repeat center;
    position: absolute;
    left: 50%;
    margin-left: -464px;
    bottom: -345px;
    z-index: 2;
    /* 第二屏手机图片 */
}
.screen2_phone div {
    width: 108px;
    height: 22px;
    font-size: 22px;
    line-height: 22px;
    color: #4d555d;
    position: absolute;
    /* 手机图片上三个亮点 */
}
.screen2_phone div:nth-child(2),.screen2_phone div:nth-child(3){
    padding: 0 0 0 112px;
    background: url(img/icon-point-left.png) center left no-repeat;
    /* 第二三个亮点图片不同,位置不同 */
}
.screen2_phone div:nth-child(1){
    padding-right: 80px;
    background: url(img/icon-point-right.png) right center no-repeat;
    top: 200px;
    left: -30px;
}
.screen2_phone div:nth-child(2){
    top: 110px;
    right: 106px;
}
.screen2_phone div:nth-child(3){
    top: 330px;
    right: -20px;
}


.screen3 {
    background-color: #a71316;
    overflow: hidden;

}
.screen3_wrap {
    width: 1200px;
    margin: 0 auto; 
}
.screen3 h2 {
    font-weight: 400;
    color: #fff; 
    padding: 80px 0 40px;
    font-size: 40px;
    /* 第3屏主要(标题)文字 */
}
.screen3 h3 {
    color: #fff; 
    font-weight: 400;
    line-height: 28px;
    font-size: 16px;
    /* 第3屏副标题文字 */
}
.screen3_phone {
    width: 928px;
    height: 873px;
    background: url(img/bg-screen-3.png) no-repeat center;
    background-size: 700px 670px;
    position: absolute;
    left: 33%;
    bottom: -170px;
    z-index: 2;
    /* 第3屏手机图片 */
}
.screen3_features {
    width: 250px;height: 250px;
    position: absolute;
    top: 50%;left: 50px;
    text-align: center;
    /* 四个特点的总样式,定位,居中(并传递给内部元素) */
}
.screen3_features div{
    display: inline-block;
    width: 99px;height: 99px;
    border: 1px solid white;
    margin: 10px;
    font-size: 16px;
    color: white;
    /* 两个一排 */
}
.screen3_features span {
    font-size: 30px;
    display: block;
    padding: 15px 0;
    /* 内部数字的样式,并用padding撑开使元素居中效果 */
}


.screen4 {
    text-align: center;
    overflow: hidden;
}
.screen4_type {
    /* border:1px solid red; */
    width: 100%;
    display: flex;
    justify-content: space-around;
    margin-top: 100px;
}
.screen4 .name {
    font-size: 16px;
    margin: 30px 0 20px;
}
.screen4 .storage {
    font-size: 14px;
    color: rgb(187, 185, 185);
}


.screen5 {
    background-color: #d9dde1;
}
.screen5 .back{
    height: 700px;
    background: url(img/bg-screen-5.png) no-repeat;
    background-position: center bottom;
    background-size: 140% 70%;
    /* 第五屏背景图 */
}

.content .buy {
    height: 300px;
    background: url(img/bg-screen-buy.png) no-repeat;
    background-size: 100% 300px;
    text-align: center;
    /* 按钮,文字居中 */
    padding-top: 110px;
    /* 购买按钮的背景图 居中 */
}
.buy a {
    color: white;
    font-size: 30px;
    background-color: red;
    display: inline-block;
    width: 300px;
    height: 80px;
    line-height: 80px;
    border-radius: 5px;
    /* 按钮样式 */
}
/* content end */

/* footer start */
.footer {
    background-color: #07111b;
    height: 80px;
    color: white;
    font-size: 14px;
    text-align: center;
    line-height: 80px;
}
/* footer end */

 

转载于:https://www.cnblogs.com/sandraryan/p/11313343.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 微信小程序是现代社会中越来越受欢迎的一种应用方式,无论是企业还是个人,都可以通过开发微信小程序来实现自己的商业目标。对于刚接触微信小程序开发的人来说,需要学习相关的知识和技能,以便能够在实践中开发高质量的微信小程序。 《微信小程序开发案例教程慕课版pdf》是一本非常有用的开发指南,通过讲解多个实际的案例,介绍了微信小程序开发中的关键概念、技术和工具。这本书可以帮助读者熟悉微信小程序的开发流程和相关技术,从而提高开发速度和质量。 从内容上看,这本书有以下几个方面的优势: 1.案例丰富:《微信小程序开发案例教程慕课版pdf》中介绍了多个实际的案例,如点餐系统、电商平台、文化衫设计等,每个案例都包含了具体的设计和实现过程,让读者能够全面了解微信小程序开发的各个方面。 2.简明易懂:本书的语言简洁明了,注重讲解技术概念和实现步骤,同时也包含了大量的图例和代码示例,让读者更容易理解和运用所学知识。 3.实战强化:每个案例中都包含了一些典型的问题和解决方案,读者可以对照自己的实际开发需求,学习如何利用微信小程序开发解决实际问题。 总的来说,《微信小程序开发案例教程慕课版pdf》是一本非常实用的开发指南,可以帮助有志于学习微信小程序开发的人迅速入门并掌握相关技能。无论是自学还是参加培训,都可以通过这本书来提高自己的学习效率和开发水平。 ### 回答2: 微信小程序是一款非常流行的手机应用程序。它可提供以下服务:免费聊天、支付、分享、地图等功能,是运营商和用户之间进行沟通的最佳桥梁。微信小程序开发案例教程慕课版pdf是一份非常详细的小程序开发教程,可以帮助开发者更好地掌握微信小程序的开发技巧。 首先,《微信小程序开发案例教程慕课版pdf》包含了基础概念与框架的教学,可以帮助开发者理解微信小程序的基本原理和开发框架。其次,该教程还涵盖了小程序开发基础、功能实现、案例分析、调试以及发布等方面。最后,《微信小程序开发案例教程慕课版pdf》还提供了许多实例代码和模板,方便学习者练习。 此外, 此教程还以案例为主,涵盖了日常生活中常用的小程序,例如:点餐、报名、商城等,以及自定义组件与动画。因此,阅读此教程可以让开发者更好地了解小程序的开发并能够自己进行一些简单的小程序的开发。 总之, 微信小程序开发案例教程慕课版pdf通俗易懂、内容详实。看完本教程,开发者可掌握微信小程序开发的基础知识和技巧,对于微信小程序的日常开发也有所帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值