设计和实施网站时有哪些最佳实践和惯例?

发布于 2024-07-22 04:07:51 字数 114 浏览 8 评论 0原文

我很快就会开发一个包含静态和动态内容的个人网站(从静态内容开始,随着时间的推移使用自定义编写的组件和开源解决方案添加动态内容),但是我相当新到网页设计和开发,所以关于目录结构、文件名、文档结构等任何建议。 谢谢。

I'll soon be working on a personal website that will include static and dynamic content (starting with static content, with dynamic content added over time using both custom-written components as well as open-source solutions), however I'm fairly new to web design and development, so any advice on things such as directory structure, file names, document structure...anything. Thanks.

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

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

发布评论

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

评论(5

等待我真够勒 2024-07-29 04:07:51

确保您认真地将脚本 (javascript) 和样式 (css) 与内容分开。

无论是简单的静态页面还是动态生成的页面,都很容易得意忘形并在内容页面中嵌入样式。 而且以后再回去清理就更困难了。

另外,从一开始就尝试尽可能远离基于表格的布局。 使用 div 代替。 如果您不熟悉网页设计,那么它们可能很难工作,但 div 在日志运行中更加灵活。

考虑使用 JavaScript 框架:Prototype.jsjQuery 就可以了,而且它们可以节省大量处理浏览器不一致的时间。

这个清单一直在不断地增长……这些只是我现在想到的一些事情。

PS 使用源代码管理。 就像任何其他软件项目一样,如果您想要回滚或只是决定在分支中尝试新功能,版本控制系统将提供巨大帮助。

Make sure that you're diligent about separating the scripts (javascript) and styling (css) from content.

It's very easy to get carried away and leave styling embedded through your content pages, be they simple static or dynamically generated pages. And it is much harder to go back and clean up later.

Also, try to stay away from the table-based layout as much as possible right from the start. Use divs instead. They can be tricky to get working if you're not familiar with web design but divs are much more flexible in the log run.

Consider using a javascript framework: either Prototype.js or jQuery will do just fine and they will save a lot of time dealing with browser inconsistencies.

And the list goes on and on.. These were just a few things a thought of off the top of my head right now.

P.S. Use source control. Just as with any other software project, a versioning system will help tremendously if you ever want to roll back or simply decide to experiment with a new feature in a branch..

我的影子我的梦 2024-07-29 04:07:51

不要重新发明轮子。

为什么不使用内容管理系统,例如 DrupalWordpress 可以通过使用模块进行定制和扩展。

这两种解决方案都基于 LAMP(Linux、Apache、MySQL 和 PHP)。

Don't reinvent the wheel.

Why not use a content management system such as Drupal or Wordpress which can be customised and extended through the use of modules.

Both of these solutions are based on LAMP (Linux, Apache, MySQL and PHP).

街角卖回忆 2024-07-29 04:07:51

不确定这是否是您认为的最佳实践或惯例,但我会从您网站的地图开始。 您将在那里放置什么类型的页面,如何组织它们以及如何构建导航。

我总是从这样的问题开始:“我想要这个网站做什么?” 和“谁会浏览这个网站?” 然后从那里开始。

还要考虑这个网站的重要性。 您是否打算专注于它直到完成,还是只是为了好玩或在时间允许的情况下做的事情? 如果是后者,请考虑从小事做起。 我经常看到人们创建个人网站但从未完成它(包括我)。 更糟糕的是,当我看到人们贴出一两页,然后有 10 页“即将推出”。

Not sure if this is something you would consider a best practice or convention but I would start with a map of your web site. What kinds of pages are you going to put up there, how will you organize them and how will you construct the navigation.

I always start with questions like "What do I want this web site to do?" and "Who is going to be looking at this site?" and go from there.

Also consider how important this site is. Do you plan to focus on it until completion or is it something you are doing just for fun or when time allows? If the latter consider starting small. All to often I see people start personal web sites and never complete it (including me). The worse is when I see people put up a page or two and then have 10 pages of "coming soon".

尛丟丟 2024-07-29 04:07:51

可用性是你的朋友。 Steve Krug 的 Don't Make Me Think! 非常好,给出了以下示例要遵循的约定等

Usability is your friend. Steve Krug's Don't Make Me Think! is pretty good, giving examples of conventions to follow etc.

晌融 2024-07-29 04:07:51

在 Firefox* 中开发/设计,然后在 IE 中测试。 如果你尝试相反的做法,你会把自己逼疯的。

*(根据需要替换任何非 IE 浏览器)

Develop/Design it in Firefox*, test it afterward in IE. You'll drive yourself nuts if you try it the other way around.

*(substitute any non-IE browser as desired)

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