web前端入门到实战:宣传页项目实战

编辑器:sublime text3

标注工具:PxCook

切图工具:PS


开发前准备:设计图标注

PxCook 空格键可以上下拖动

大致标注图纸:(可惜不能文字标注和拉参考线)

开发前准备:PS切图

在指定图层上新建一个图层,使用ctrl+e 合并图层,可以将任意图层转为普通图层

(如果图层是下面图层的剪贴图层,可以把该图层移动到新建图层的上面再合并)

(如果图层羽化较多,ctrl+enter无法选中,则直接ctrl+c)

ctrl+enter 框选需要的图层内容

ctrl+c 复制图层

ctrl+n 新建画布

ctrl+v 黏贴,隐藏掉背景图层

存储为web所用格式,jpg或者png24

开发前准备(雪碧图)

用的软件是:CssGaga

将phone1-phone4四张小图生成一张雪碧图

提供图片以及css位置

静态页面开发

文字距离容器左边一定位置:

padding-left 或者 text-indent

padding-left 设置的宽度,需要在width 中减去;而text-indent 不用

index.html

专门建立的学习Q-q-u-n: 784783012 ,分享学习的方法和需要注意的小细节,不停更新最新的教程和学习技巧
(从零基础开始到WEB前端项目实战教程,学习工具,全栈开发学习路线以及规划)

<!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="base.css">
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <!-- 头部 -->
    <header>
        <div class="header-wrap">
            <div class="header-logo">微课手机</div>
            <nav class="header-nav">
                <a href="javascript:void(0);" class="header-nav-item header-nav-item-active">外观</a>
                <a href="javascript:void(0);" class="header-nav-item">配置</a>
                <a href="javascript:void(0);" class="header-nav-item">型号</a>
                <a href="javascript:void(0);" class="header-nav-item">说明</a>
                <a href="javascript:void(0);" class="header-nav-item">其他产品</a>
                <a href="javascript:void(0);" class="header-nav-item header-nav-item-button">立即购买</a>
            </nav>
    </header>
    <!-- 第一屏 -->
    <div class="screen-1">
        <h2 class="screen-1-heading"><span>微课手机</span> 让你的生活更精彩</h2>
        <div class="screen-1-phone"></div>
        <div class="screen-1-shadow"></div>
    </div>
    <!-- 第二屏 -->
    <div class="screen-2">
        <div class="screen-2-wrap">
            <h2 class="screen-2-heading">优美的设计,更令人着迷</h2>
            <h4 class="screen-2-subheading">采用受欢迎的设计,让它更加出色。<br> 款式小巧、轻便手感更舒适。绚丽高清的显示屏,整个外观显得格外精致。</h4>
            <div class="screen-2-phone">
                <div class="screen-2-point screen-2-point-i1">高清摄像</div>
                <div class="screen-2-point screen-2-point-right screen-2-point-i2">超薄机身</div>
                <div class="screen-2-point screen-2-point-right screen-2-point-i3">大屏显示</div>
            </div>
        </div>
    </div>
    <!-- 第三屏 -->
    <div class="screen-3">
        <div class="screen-3-wrap">
            <h2 class="screen-3-heading">优美的设计,更令人着迷</h2>
            <h4 class="screen-3-subheading">采用受欢迎的设计,让它更加出色。<br> 款式小巧、轻便手感更舒适。绚丽高清的显示屏,整个外观显得格外精致。</h4>
            <div class="screen-3-phone"></div>
            <div class="screen-3-detail">
                <div class="screen-3-detail-item">
                    <div class="screen-3-detail-num">5.7</div>
                    <div class="screen-3-detail-desc">英寸大屏</div>
                </div>
                <div class="screen-3-detail-item">
                    <div class="screen-3-detail-num">1200</div>
                    <div class="screen-3-detail-desc">万像素</div>
                </div>
                <div class="screen-3-detail-item">
                    <div class="screen-3-detail-num">3D</div>
                    <div class="screen-3-detail-desc">Touch</div>
                </div>
                <div class="screen-3-detail-item">
                    <div class="screen-3-detail-num">A9</div>
                    <div class="screen-3-detail-desc">处理器</div>
                </div>
            </div>
        </div>
    </div>
    <!-- 第四屏 -->
    <div class="screen-4">
        <div class="screen-4-wrap">
            <h2 class="screen-4-heading">丰富的手机型号</h2>
            <h4 class="screen-4-subheading">找到适合你的手机</h4>
            <div class="screen-4-phone screen-4-phone-i1">
                <div class="screen-4-phone-item">
                    <div class="screen-4-phone-color">微课红</div>
                    <div class="screen-4-phone-model">32G/64G/138G</div>
                </div>
                <div class="screen-4-phone-item screen-4-phone-i2">
                    <div class="screen-4-phone-color">土豪金</div>
                    <div class="screen-4-phone-model">32G/64G/138G</div>
                </div>
                <div class="screen-4-phone-item screen-4-phone-i3">
                    <div class="screen-4-phone-color">太空灰</div>
                    <div class="screen-4-phone-model">32G/64G/138G</div>
                </div>
                <div class="screen-4-phone-item screen-4-phone-i4">
                    <div class="screen-4-phone-color">绅士黑</div>
                    <div class="screen-4-phone-model">32G/64G/138G</div>
                </div>
            </div>
        </div>
    </div>
    <!-- 第五屏 -->
    <div class="screen-5">
        <h2 class="screen-5-heading">游戏、学习、拍照,有这一部就够了</h2>
        <h4 class="screen-5-subheading"> 看视频、拍摄高清视频与照片、视频聊天、通话相结合,一机多功能,让您生活更丰富精彩。 </h4>
    </div>
    <!-- 第六屏 -->
    <div class="screen-6">
        <button class="screen-6-btn">立即购买</button>
    </div>
    <!-- 底部 -->
    <footer>© 2020&nbsp;&nbsp;test.com&nbsp;&nbsp;浙ICP备00000000号</footer>
</body>
</html>

base.css

*{ margin:0; padding:0;
} a{ text-decoration: none; color:#44484d;
} ul{ list-style:none;
} body{ color:#44484d;
} h2{ font-size:48px; font-weight:lighter; padding-top:81px; padding-bottom:15px;
} h4{ font-size:16px; line-height:30px; font-weight:normal; padding-bottom:15px;
}

/*# sourceMappingURL=base.css.map */

style.css

专门建立的学习Q-q-u-n: 784783012 ,分享学习的方法和需要注意的小细节,不停更新最新的教程和学习技巧
(从零基础开始到WEB前端项目实战教程,学习工具,全栈开发学习路线以及规划)

/*头部*/ header{ background:#f7f7f7; width:100%; height:80px;
} .header-wrap{ width:1200px; height:100%; margin:0 auto; position: relative;
} .header-logo{ width:140px; height:39px; margin-left:24px; background:url(img/logo.png) left center no-repeat; background-size:39px 39px; text-indent:51px; line-height:39px; position: absolute; top:50%; margin-top:-20px; font-size:20px;
} .header-nav{ position: absolute; right:24px; height:39px; line-height:39px; top:50%; margin-top:-20px; font-size:14px;
} .header-nav-item{ display: block; float:left; margin-left:45px;
} .header-nav-item-active{ color:#f04747; position: relative;
} .header-nav-item-active::after{ content:""; display: block; height:2px; width:100%; position: absolute; top:39px; left:0; background-color: #f04747;
} .header-nav-item-button{ width:90px; height:39px; background-color:#07111b; color:#f4f4f5; text-align: center; border-radius:3px;
}

/*第一屏*/ .screen-1{ width:100%; height:795px; background:url(img/screen-1-bg.png) no-repeat; background-size:cover; text-align: center; position: relative;
} .screen-1-heading{ padding-top:138px; padding-bottom:94px; color:#4d555d;
} .screen-1-heading span{ color:#f04747;
} .screen-1-phone{ background:url(img/screen-1-phone.png) center no-repeat; width:1375px; height:305px; left:50%; margin-left:-687px; position: absolute; bottom:180px; z-index:2;
} .screen-1-shadow{ background:url(img/screen-1-shadow.png) center no-repeat; width:1183px; height:367px; left:50%; margin-left:-591px; position: absolute; bottom:30px; z-index:1;
}

/*第二屏*/ .screen-2{ width:100%; height:800px; background:#fafafa;
} .screen-2-wrap{ width:1200px; height:100%; margin:0 auto; text-align: center; position: relative;
} .screen-2-heading{ color:#f04747;
} .screen-2-subheading{ color:#4d555d;
} .screen-2-phone{ background:url(img/screen-2-phone.png) center no-repeat; width:928px; height:530px; left:50%; margin-left:-464px; position: absolute; bottom:0;
} .screen-2-point{ font-size:24px; font-weight:lighter; width:104px; padding-right:97px; background:url(img/screen-2-point-left.png) center right no-repeat; position: absolute;
} .screen-2-point-right{ padding-right:0; padding-left:97px; background:url(img/screen-2-point-right.png) center left no-repeat;
} .screen-2-point-i1{ top:160px; left:-153px;
} .screen-2-point-i2{ top:40px; right:150px;
} .screen-2-point-i3{ top:340px; right:40px;
}

/*第三屏*/ .screen-3{ width:100%; height:800px; background:#fafafa; background:url(img/screen-3-bg.png) no-repeat; background-size:cover;
} .screen-3-wrap{ width:1200px; height:100%; margin:0 auto; position: relative; color:#fff;
} .screen-3-phone{ background:url(img/screen-3-phone.png) top right no-repeat; width:767px; height:576px; right:0; position: absolute; bottom:0;
} .screen-3-detail{ margin-top:152px; width:333px;
    /*height:275px;*/
} .screen-3-detail-item{ width:140px; height:127px; border:1px solid #cd6d6f; float:left; border-radius:3px; margin-right:24px; text-align: center; margin-bottom:18px;
} .screen-3-detail-num{ font-size:48px; line-height:48px; padding-top:24px;
} .screen-3-detail-desc{ padding-top:5px;
}

/*第四屏*/ .screen-4{ width:100%; height:800px;
} .screen-4-wrap{ width:1200px; height:100%; margin:0 auto; position: relative; text-align: center;
} .screen-4-heading{ padding-top:120px; padding-bottom:21px; color:#f04747;
} .screen-4-subheading{ padding-bottom:55px;
} .screen-4-phone{ width:1148px; height:355px;
} .screen-4-phone-item{ width:218px; height:355px; margin-right:92px; float:left; background:url(img/screen-4-phone.png) -26px top no-repeat;
} .screen-4-phone-i1{ background-position:-21px 0;
} .screen-4-phone-i2{ background-position:-301px 0;
} .screen-4-phone-i3{ background-position:-574px 0;
} .screen-4-phone-i4{ background-position:-846px 0; margin-right:0;
} .screen-4-phone-color{ padding-top:307px; font-size:16px;
} .screen-4-phone-model{ padding-top:9px; font-size:12px; color:#d8dadc;
}

/*第五屏*/ .screen-5{ width:100%; height:800px; background:url(img/screen-5-bg.png) center bottom no-repeat; background-color: #d9dde1; text-align: center;
} .screen-5-heading{ padding-top:120px; padding-bottom:21px; color:#f04747;
} .screen-5-subheading{ padding-bottom:55px;
}

/*第六屏*/ .screen-6{ width:100%; height:202px; background-color: #d9ddd1; background:url(img/screen-6-bg.png); text-align: center; padding-top:118px;
} .screen-6-btn{ width:243px; height:78px; line-height:78px; text-align: center; background:#f01414; color:#fff; border-radius:3px; font-size:24px; font-weight:lighter; border:none; box-shadow:0 0 10px rgba(0,0,0,.5); display: inline-block;
}

/*底部*/ footer{ text-align: center; color:#fff; width:100%; height:80px; line-height:80px; background-color: #07111b; font-size:12px; font-weight:lighter;
}
/*# sourceMappingURL=style.css.map */

此时静态页面已经完成

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 194,088评论 5 459
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 81,715评论 2 371
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 141,361评论 0 319
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 52,099评论 1 263
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 60,987评论 4 355
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 46,063评论 1 272
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 36,486评论 3 381
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 35,175评论 0 253
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 39,440评论 1 290
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 34,518评论 2 309
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 36,305评论 1 326
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 32,190评论 3 312
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 37,550评论 3 298
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 28,880评论 0 17
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,152评论 1 250
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 41,451评论 2 341
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 40,637评论 2 335

推荐阅读更多精彩内容