将 PSD 转换为网站

发布于 2024-08-19 16:29:54 字数 263 浏览 11 评论 0原文

我正在学习 Web 开发,但我已经陷入困境了。

如何将 PSD 模板转换为 html/css 网站?

我已经裁剪了图像的所有部分并将它们分别保存在 .gif 中,但是然后呢?我是否必须手动将它们放入 Dreamweaver 空模板中?我认为有一种自动化的方法可以做到这一点..

另外,我尝试过“保存为网络和设备..”但是在保存时,它会创建一个 .html 文件和一个包含每个元素的单个图像?!我期望有几张图像,以便我可以在 Dreamweaver 中重新排列它们。

I'm learning web dev and I am already stucked at some point..

How do I convert a PSD template to a html/css website ?

I've cropped all part of the image and saved them in .gif separately, but then ? Do I have to manually place them in a dreamweaver empty template ? I thought there was an automated way to do so..

Also, I've tried "Save for web and devices.." but when saving, it creates a .html file and a single image which contains every element ?! I expected several images so that I could rearrange them in dreamweaver.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

祁梦 2024-08-26 16:29:54
  1. 虽然某些应用程序宣传/提供从复合图形到网页布局的“转换”过程的自动化,但您希望避免使用这些功能。它们会给你带来比其价值更多的麻烦。特别是如果您打算使用 CSS 进行布局(我强烈鼓励)。这并不是说这些功能没有一些有限的有效用途(更多内容请参见第 2 点),只是它们不会神奇地从图形生成您的网站。
  2. 为了使用“保存为网页...”,您需要使用切片工具将图像切成布局所需的不同图像。然后,当您使用 html 保存为 web 和 deices 时,它将导出 html/css 和图像。再说一遍,这并不是魔法,您很可能必须完全重做它为您所做的大部分工作 - 使它除了切片布局的某个区域(例如单个菜单)之外毫无用处。

一般来说,没有一种完全自动化的方法可以做到这一点,因为根据您需要布局的内容,您必须以不同的方式进行布局,而理论上可以以一个很好的方式考虑所有可能的潜在需求。导出 GUI 它并不真正可行。

最重要的是要做到这一点,你必须学习 HTML/CSS。你学得越多,你就会越讨厌 Dreamweaver(至少在“布局视图”中)。保证。

  1. While certain applications advertise/provide automation of the "conversion" process from composite graphic to web layout you want to avoid using those features. They will cause you more trouble than they are worth. Especially if you are going to use CSS for layout (which I strongly encourage). Thats not to say those features dont have some limited valid usages (more on this in point 2) it just that they arent going to magically generate your site from a graphic.
  2. In order to use "Save for Web..." you need to use the Slice tool to slice down the image into the different images you need for layout. Then when you do save for web and deices with html it will export the html/css and the images. Again this isnt magic and chances are youre going to have to completely redo most of what its done for you - making it useless for anything more than slicing a certain area of the layout (say a single menu).

There isnt a fully automated way to do this, generally speaking because depending on what you need the layout to do you have to go about laying things out in different ways and while its theoretcially possible to account for all the possible potential requirements in a nice little export GUI its not really feasible.

The bottom line is to do this you have to learn HTML/CSS. And the more you learn the more you will hate Dreamweaver (at least in "layout view"). Garaunteed.

迷迭香的记忆 2024-08-26 16:29:54

是的,网页设计并不是靠魔法就能实现的。正确的方法是手动编写定位元素的实际代码,而不仅仅是将它们放在 Dreamweaver 中。有很多很好的教程,例如:

Yea, web design doesn't work by magic. The proper way to do is to manually write the actual code that positions the elements, not just smack them in place in Dreamweaver. There's plenty of good tutorials out there, check these out for example:

萌辣 2024-08-26 16:29:54

欢迎来到现实。

您必须自己对图像进行切片和切块(好吧,您自己对图像进行切片和切块,但无论您想多切,都不要自己切块),然后将每个单独的部分放入 HTML 或模板中。

Welcome to reality.

You'll have to slice and dice yourself (well, slice and dice the image yourself, but don't slice yourself no matter how much you want to), and then place each individual part in your HTML or template.

A君 2024-08-26 16:29:54

有许多自动化服务可以为您转换 PSD:

但是,您可能还想考虑基于服务的方法。那里有一个蓬勃发展的专业切片器社区(只需谷歌“psd to html”,您就会明白我的意思)。

您还可以尝试从程序或框架重新设计,例如:

这实际上取决于您的预算、时间表和技能。

我非常支持在尝试实现自动化之前先充分理解某件事。因此,就像其他发帖者所说的那样,从头开始切片(手动编码)非常有价值,特别是如果您还没有很好地理解它的话。然而,您可能只是不愿意投入时间来充分理解该主题。而且,这也完全没问题。

我认为归根结底,没有“正确”的解决方案。不同的人有不同的要求,从而会改变选择。

There are a number of automated services that convert PSDs for you:

However, you might also want to consider a service-based approach as well. There is a thriving community of professional slicers out there (just google "psd to html" and you'll see what I mean).

You might also try to redesign from a program or framework such as:

It really depends on your budget, your timelines and your skillset.

I'm a big proponent of understanding something really well before trying to automate it. So, like the other posters have said, slicing by scratch (handcoding) is very valuable, especially if you don't already understand it well. However, you might just not care to invest the time needed to achieve a good understanding of the subject. And, that's perfectly okay too.

I think that ad the end of the day, there is no "correct" solution. Different people have different requirements which will change the choice.

计㈡愣 2024-08-26 16:29:54

可能会帮助您,它会引导您完成整个过程。

This may help you, it walks you through the process.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文