PSD文件切图制作html全过程记录

最后效果图:

新建文件夹

开始时,在您的计算机中创建一个文件夹。我把它命名为zmool。再在文件夹中创建新文件夹images,放网站的所有图像。接下来打开代码编辑器(Dreamweaver),并在根目录下创建一个HTML文件名为index.html,这是我们的主页模板。现在创建一个新的CSS文件,并将其命名为style.css文件。如下图:

打开index.html文件。在head标签顶部,添加链接到您的样式表(style.css)。你可以使用下面的代码。

头部的代码如下面:

Modern Design Studio

建立HTML结构

现在,我们将设置HTML文件结构。设置3个部分(标题,内容,页脚)像下面一样:

Untitled Document

切割背景

我们的PSD文件包含了很多纹理效果,我们要把这些全部切出来,然后,用代码添加到网页上面,使div页面效果和设计的效果达到一致。

现在在photoshop里面打开原先设计好的,隐藏所以的图层,除背景层外.

现在采取的切片工具,选择背景,保存网页web格式按(ALT +shift+Ctrl + S)。然后保存的图像文件夹文件名为background.jpg。

设置背景样式

打开style.css文件,设置基本样式,还有背景样以及主体部分的宽度,如下代码:

* {

margin: 0px;

padding: 0px;

}

body

{

background:url(images/background.jpg);

}

#container

{

margin: auto;

width: 960px;

}

切割头部

返回photoshop,隐藏所以图层,除头部背景外,并用同样的方法,把头部背景图片切割保存为web格式,保存文件名为head.jpg。

编辑头部背景代码

在style.css文件里编辑如下代码:

#header

{

background:url(images/header.jpg);

height:124px;

}

切割头部logo

在这时,切割logo层,隐藏所有图层,包括背景层,如上同样方法切割logo层保存为logo.png,注意:保存为png格式图片

添加在页面添加logo

现在返回到html中,在#header #container内,添加下面的代码

....

.

现在,下面切换到style.css文件,编写#logo样式.

#logo

{

margin-top:20px;

border:none;

}

编辑导航代码

下面是页面里的代码,头部header包括logo和导航两个部分.

  • Home
  • About
  • Work
  • Blog
  • Contact

导航样式如下:

现在,添加css表里的导航样式~,ul、li和链接a的样式:

#header li

{

color:#959595;

list-style:none;

float:left;

margin-right:20px;

font-family:"Myriad Pro",arial;

font-weight:bold;

font-size:24px;

}

#header li a

{

color:#959595;

text-decoration:none;

padding:10px;

}

#header ul

{

float:right;

margin-top:-40px;

}

#header li a:hover

{

background:#202020;

color:#d2d2d2;

-moz-border-radius:5px;

-khtml-border-radius:5px;

-webkit-border-radius:5px;

}现在制作中间部分

现在我们在页面的中间部分content添加两个div,如下图:

切换到photoshop的psd页面,切下中间部分,取名为featured.jpg.如下图:

在你的HTML页面添加如下代码,和一些文字介绍:

MORE PROJECTS

Portfolio project, Jan 5th, 2010 Have you

ever wanted to create clean and nice portfolio design? In this tutorial I

will show you how to design clean blue portfolio layout. Have you ever wanted

to create clean and nice portfolio design? In this tutorial I will show you how

to design clean blue portfolio layout in Adobe Photoshop.

在PSD文件里,隐藏其他所以图层,只留下按钮图层部分,切下按钮部分,保存png格式,命名为button.png.

现在我们把这些图片添加到页面中去,切换到css文件页面,添加如下代码,这里包括背景样式,和按钮的样式.

#featured

{

background:url(images/featured.jpg) no-repeat;

height:381px;

margin-top:30px;

margin-left:80px;

}

#featured a

{

background:url(images/button.png);

height:30px;

width:124px;

text-indent:-9999px;

position:absolute;

margin-top:330px;

margin-left:180px;

}

#featured a:hover

{

background-position:0px 30px;

}现在我们添加些dummytext(文字介绍)的样式:.dummytext

{

color:#d2d2d2;

width:245px;

margin-top:150px;

position:absolute;

font-family:Arial, Helvetica, sans-serif;

font-size:12px;

line-height:180%;

margin-left:290px;

}

.dummytext span

{

font-size:16px;

color:#191919;

font-weight:bold;

}下面添加添加图片展示下面的分类介绍部分

页面的代码部分如下.

BEAUTIFULWebDesignFan is a design related blog about web design, photoshop, freebies

and tutorials. We publish useful information dedicated to web designers and developers. Here you can find free

resources like vectors, wordpress themes and a lot of inspiration.

EFFECTIVEWebDesignFan is a design related blog about web design, photoshop, freebies

and tutorials. We publish useful information dedicated to web designers and developers. Here you can find free

resources like vectors, wordpress themes and a lot of inspiration.

FUNCTIONALWebDesignFan is a design related blog about web design, photoshop, freebies

and tutorials. We publish useful information dedicated to web designers and developers. Here you can find free

resources like vectors, wordpress themes and a lot of inspiration.

我们中间部分的内容,整体看起来应该是这样的:

MORE PROJECTS

Portfolio project, Jan 5th, 2010 Have you

ever wanted to create clean and nice portfolio design? In this tutorial I

will show you how to design clean blue portfolio layout. Have you ever wanted

to create clean and nice portfolio design? In this tutorial I will show you how

to design clean blue portfolio layout in Adobe Photoshop.

BEAUTIFULWebDesignFan is a design related blog about web design, photoshop, freebies

and tutorials. We publish useful information dedicated to web designers and developers. Here you can find free

resources like vectors, wordpress themes and a lot of inspiration.

EFFECTIVEWebDesignFan is a design related blog about web design, photoshop, freebies

and tutorials. We publish useful information dedicated to web designers and developers. Here you can find free

resources like vectors, wordpress themes and a lot of inspiration.

FUNCTIONALWebDesignFan is a design related blog about web design, photoshop, freebies

and tutorials. We publish useful information dedicated to web designers and developers. Here you can find free

resources like vectors, wordpress themes and a lot of inspiration.

去你的CSS文件添加下面的代码,

#paragraphs span

{

font-family:"Myriad pro", Helvetica, sans-serif;

font-size:22px;

font-weight:600;

letter-spacing:-2px;

}

#paragraphs

{

margin-left:80px;

font-family:Arial, Helvetica, sans-serif;

color:#191919;

font-size:12px;

margin-top:15px;

}

.paragraph

{

width:250px;

margin-left:15px;

float:left;

}这个就是我们到目前位置的效果:

下面处理网站底部

现在,我们完成该部分内容,我们将开始创建页脚.

首先,在你的PSD文件中,隐藏除页脚和页脚纹理层外的其他层,然后把页脚文件夹的东西切片并保存为footer.jpg.

然后再切一遍,把按钮和鸟的图形切下来.分别取名为follow.png和bird.jpg.

编辑底部代码

底部页脚包括一些文字和一个带有链接的小鸟图片.

所以在HTML页面添加如下代码.

2010 ? Fictional Design Studio. Design by Webdesignfan.

Follow us on Twitter

现在,编辑底部footer样式的代码,如下:

#footer

{

background:url(images/footer.jpg);

height:71px;

margin-top:191px;

}

#footer p

{

font-family:Arial, Helvetica, sans-serif;

font-size:12px;

color:#959595;

position:absolute;

margin-top:30px;

}

#footer a

{

background:url(images/follow.png);

text-indent:-9999px;

position:absolute;

height:27px;

width:124px;

margin-left:730px;

margin-top:30px;

}

#footer img

{

float:right;

margin-top:10px;

}我们用footer.jpg做页脚的背景,然后添加一些文字的样式.

对于底部的鸟图片的链接,我们用之前同样的办法,利用浮动效果定位。

最终效果原文件下载:

psd-to-html.rar 8fb67b226f1b6baeccc43f88921d866c.rar (706.19 KB)

psd文件生产html,PSD文件切图制作html全过程记录相关推荐

  1. PSD网页切图制作HTML全过程教程 1

    http://www.uimaker.com/uimakerhtml/uistudy/2010/0430/3379.html

  2. 根据PSD登陆页面设计稿切图制作HTML网页全过程

    切图的目的是把PSD设计稿转换为HTML页面.记得自己当时学习切图时,网上切图相关的文章是不少,但是大都是讲怎么使用切片工具把一张图片分割成多张图片,然后存储为Web使用格式,并且都比较简单和零碎,并 ...

  3. ai怎么切图制作html,APP扁平化设计最强AI切图工具推荐与AI切图教程

    目前很多APP设计师使用了AI软件来进行一些扁平化的设计,包括设计APP界面设计.APP引导页界面设计.APP图标设计等等.但是在AI里面切图是非常的不方便.于是,为了解决大家这个烦恼. AI设计师的 ...

  4. 自动切图生成html,Photoshop如何实现UI自动切图?_html/css_WEB-ITnose

    切图严格来说并不是UI设计师的工作, 而是前端工程师的工作,指的是将UI设计师的设计(大部分为photoshop创建的PSD文件)转化为界面(网页或窗体等)所需要资源的过程. 切图是衔接UI设计和应用 ...

  5. Web前端工程师必备的PS技能之切图

    1.        PS中我的标尺的参考线为什么不能自动吸附图层或画布中间了?有个选项没有选择"菜单栏-视图-对齐",勾选下,里面的选项你可以看着勾选.还有一点要注意,你想吸附到图 ...

  6. [超级懒人最简单法]iPhone 6 plus 适配切图方法分享(转载文章)

    网络上已经有很多适配教程,可是看了半天总是半懂不懂..最后还是要综合多个教程再动动脑子动动手,最好有程序大哥帮你试一下(这得有多大的福气) 如果有跟我一样情况的: 1.       有人说用sketc ...

  7. 来自妹子的需求:App的logo自动切图脚本

    文章目录 一.来自女朋友的切图需求 二.一键切图大致原理 1.大致思路 2.linux下图片缩放工具 (1)安装ImageMagick (2)子命令生成图片 (3)查看生成图片尺寸信息 三.生成不同尺 ...

  8. 开源影像tif切图工具gdal2tiles部署以及切图

    切片效果图 安装python,这个网上很多教程,参照网上教程安装即可,这里不再描述. python安装python版本的gdal,以我本机python3.7版本为例: 下载gdal的whl文件安装包, ...

  9. 利用MapTiler工具进行地图瓦片切图,适合用于在h5中显示手绘地图场景

    1.利用工具下载卫星图层,我用的是"BIGEMAP地图下载器",官网地址:http://www.bigemap.com/ 选择好要切图的区域,记录下经纬度范围并选择导出的等级. 完 ...

最新文章

  1. 编译安装LNMP Centos 6.5 x64(6.6 x64) + Nginx1.6.0 + PHP5.5.13 + Mysql5.6.19
  2. 2019区块链行业指南
  3. var和dynamic的区别及如何正确使用dynamic?
  4. Spring Cloud Config入门(本地配置)
  5. 【Python】获取星期字符串
  6. 【问题解决:死锁】Lock wait timeout exceeded; try restarting transaction的问题
  7. 再次翻看WCF的书籍
  8. Windows常用运行库--VC++、DirectX、.NET
  9. bat windows10系统垃圾清理---
  10. Hadoop的容错性
  11. 四种快速简单添加视频字幕的方法,总有一款适合你
  12. 死链提交为什么不能提交 html文件,搜狗死链提交
  13. 1977年发生事件_历史回放:日本1977年海怪尸体事件
  14. 项目管理商业文件(第一章)
  15. OCR--苹果ios安卓android身份证拍照扫描识别sdk
  16. Java编程之华氏和摄氏的转换
  17. 转载:微软内部职位分类和待遇
  18. 【转】从P1到P7——我在淘宝这7年
  19. 在qt实现手机通讯录系统_通讯录管理系统的设计与实现(QT,SQlite)
  20. SwitchHosts 工具

热门文章

  1. Android应用图标设计
  2. API接口开发其实特简单,Python FastApi Web 框架教程来了
  3. 征文连载丨MogDB企业应用之七种武器
  4. 空间平滑可以解相干的原因
  5. UnityShader入门精要——消融效果
  6. MATLAB实现多目标粒子群优化算法(MOPSO)
  7. cutterman 从安装到使用
  8. 清华镜像pip安装命令
  9. 树莓派控制WS2812屏幕(python)
  10. 【Linux驱动】Linux--V4L2视频驱动框架