通过最佳实践组织和清理大型网站

发布于 2024-11-03 09:32:54 字数 309 浏览 3 评论 0原文

好吧,所以在我找到现在的工作之前,我一直觉得对 CSS 有很好的理解。他们让我做的第一件事就是清理他们整个基于网络的会计和库存系统。存在交叉兼容性问题。该系统极其庞大,有 150 多个页面。主要问题是开发者在开发系统时并没有真正使用最佳实践(CSS)。该系统是由一张包含 1800 多行代码的样式表设置的,实际上没有任何结构。另一个主要问题是该网站主要由表格组成,并且许多表格以及其他元素具有内联样式,特别是所有输入字段(大小)。老实说,我不确定解决这个问题的最佳方法。显然,我想从 HTML 中提取所有内联样式。但找到实现这一目标的最佳方法很困难。关于推进此事的最佳方式有什么建议吗?预先感谢您的帮助。

Ok, so I have always felt that had a good understanding of CSS until I got my current job. One of the first things they are having me work on is cleaning up their entire web-based accounting and inventory system. There are problems with cross compatibility. The system is extremely vast and has over 150 pages. The main problem is that the developer did not really use best practices when he developed the system (CSS). The system is setup with one stylesheet of with over 1800 lines of code, which really has no structure. The other major problem is that the website is mostly made with tables and a lot of the tables, as well as other elements have inline styles, specifically all of the input fields (sizes). To be honest, I am not sure the best way to approach this. Obviously, I want to pull out all of the inline styles out of the HTML. But finding the best way to go about doing this is hard. Any suggestions on the best way to move forward with this? Thanks in advance for your help.

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

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

发布评论

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

评论(1

君勿笑 2024-11-10 09:32:54

我最好的建议是通过将任务分解为可管理的模块来逐步完成,并且每天执行一个。例如:

  • 使用带有 Pagespeed 扩展的 Firebug 来帮助您分析 CSS 的效率,并使用其中的建议作为整体重构的路线图。
  • 例如,通过将所有现有的内联样式传输到外部 temp.css 文件来删除它们(经常刷新以确保不会中断)。
  • 我强烈建议查看 Nicole Sullivan 与 OOCSS 的合作并选择她的网格和媒体对象之一,大多数网站布局都遵循她用非常精简的 CSS 很好地覆盖的模式。

这次你有机会做对,所以花很多时间来正确规划这一点。如果您在小提琴上发布一些内容,我可以提供帮助。小心。

My best advise is do it incrementally by breaking down the tasks into manageable modules, and do one a day. Something like:

  • Use Firebug with Pagespeed extension to help you analyse the efficiency of your CSS and use the suggestions there as a roadmap to your overall refactoring.
  • Remove all existing inline style by transferring them to an external temp.css file for example (refresh very often to ensure that nothing breaks).
  • I will strongly advise looking at Nicole Sullivan's work with OOCSS and pick one of her grids and the media object, most sites layout follow patterns that she covered very well with a very lean CSS.

You have the opportunity of making it right this time, so spend a lot of time in the proper planning of this. If you post some on fiddle I can help. Take care.

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