HTML 标准和偏差浏览器

发布于 2024-09-18 20:27:29 字数 330 浏览 8 评论 0原文

这是任何开发 Web 应用程序的人都知道的故事 - 您创建了一个网站,该网站在您选择的浏览器中编码良好且优雅 - 直到您在不同的浏览器中运行它,这很多时候需要黑客攻击和削减创建一个正常运行的网站。

我希望询问开发人员使用的技术,以确保他们的代码在众多相关的网络浏览器中第一次运行良好 - 例如:xhtml、html5、javascript、css 等。

作为旁注,什么开发人员对 IE 进步的看法 - 世界上大多数人仍在使用 IE7,而 IE9 只包括新的 css 和 html 标准,您认为标准实践(如果有的话)需要多长时间才能实现?

我对您的回复非常感兴趣,因为我对跨浏览器兼容性问题感到畏缩。

This is a story anyone developing web applications is surely aware of - You create a site, which is well coded and elegant in the browser of your choice - until you run it in a different browser, which a lot of the time required hacking and slashing to create a functioning site.

I wish to enquire the techniques used by developers to ensure their code works well the first time around in the plethora of web browsers with all aspects related - such as :xhtml, html5, javascript, css, etc..

As a side note, what developers do about IE progress - with the majority of the world still on IE7, and IE9 only including new css and html standards how long do you think standard practice will(if ever) take to achieve?

I am quite interested in your response, as I cringe at the thought of cross browser compatibly issues.

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

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

发布评论

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

评论(5

海拔太高太耀眼 2024-09-25 20:27:29

我的建议:使用合适的 CSS 重置或框架。好的 CSS 框架有:960、Blueprint、YAML 和 YUI grids。

对于您的 javascript,您应该使用类似的库:JQuery、mootools 或 Dojo。您仍然会遇到一些浏览器不兼容的问题,但使用这些工具中的任何一个都应该可以修复大约 90% 的问题。

祝你好运! (ps:我使用Mootools和Blueprint)

My advice: Use a decent CSS reset or framework. Good CSS frameworks are: 960, Blueprint, YAML and YUI grids.

For your javascript you should use a library like: JQuery, mootools or Dojo. You will still have a few browser incompatibilities, but using any of these tools should fix about 90% of them.

Good luck! (ps: I use Mootools and Blueprint)

怪我闹别瞎闹 2024-09-25 20:27:29

如果您确实想与 IE6 人群一起享受乐趣,请尝试以下操作:http://ie6update.com/

全部开个玩笑吧,有了对盒子模型策略的深刻理解、一个出色的框架,再加上 quirksmode.org,您应该没有理由必须进行一堆奇特的黑客才能使您的网站正常运行。针对当今可行的标准进行智能设计,并为演示站点保留前沿技术。高价值的企业网站不必具有异国情调,它们需要良好且可靠。否则,愿意设计并行站点,以便那些拒绝更新的人至少可以过得去。最重要的是,遵守标准……一些 W3 错误太多了。

也了解你的观众。我无法告诉你有多少设计师为年长人群设计了深色和小字体。同样,在不合适的地方使用异国情调的 JavaScript 或更糟糕的 Flash。征求他人的反馈……实际上,即使我们“得到”了这款游戏,我们也只能真正了解自己的喜好。

练习渐进增强。例如,Jquery UI 会圆角,但对于 IE(落后的)人群来说,会优雅地降级为方形。考虑使用严格的 HTML 4.01 而不是 XHTML,因为它在语法上更接近未来的 HTML5。 (无论如何,XHTML 不再先进)

最后,在多个浏览器或 Adob​​e 浏览器实验室等工具中测试您所做的一切。关闭Javascript和CSS...结果可以接受吗?无需闪光灯即可运行...您的网站可以运行吗?它在移动浏览器上看起来如何?

有时这不是一个有趣的游戏,但它使我们成为专业人士。祝你好运!

If you really want to have some fun with the IE6 crowd, try this: http://ie6update.com/

All kiding aside, with a strong understanding of box-model tactics, a great framework, plus quirksmode.org, you should have no reason to have to do a bunch of exotic hacks to make your site work. Design intelligently for standards that are viable today and save the bleeding edge techniques for demo sites. High-value corporate sites don't HAVE to be exotic, they need to be good and reliable. Otherwise, be willing to design parallel sites so that those who refuse to update can at least get by. Most of all, stick to the standards...a few W3 errors is too many.

Understand your audience too. I can't tell you how many designers do dark on dark and small fonts for older crowds. Likewise for using exotic javascript or worse flash where it's not appropriate. Solicit feedback from others....in reality, even if we "get" this game, we really only really understand our own preferences.

Practice progressive enhancement. For example, Jquery UI will round corners, but will gracefully degrade to square for the IE (behind) crowd. Consider using HTML 4.01 strict as opposed to XHTML because it is closer in syntax to the future, HTML5. (XHTML is no longer being advanced anyway)

Finally, test everything you do in multiple browsers or in a tool like Adobe's browser labs. Turn off Javascript and CSS...is the result acceptable? Run without flash...does your site work? How does it look on a mobile browser?

It's not a fun game to play sometimes, but it's what makes us professionals. Good luck!

软的没边 2024-09-25 20:27:29

我正在为所有主要浏览器(IE 6+、Firefox 3+、当前的 Safari、Chrome、Opera 9.5+)进行开发。我对保持代码整洁和消除极端黑客会话的主要建议如下:在所有浏览器中同时测试您的页面。修复多个小问题比一次性修复整个页面要容易得多。以这种方式工作时,风格问题确实很容易解决。 JavaScript 更具挑战性,但像这样工作时仍然容易得多。 jQuery 通常可以帮助解决此类问题。我到处都包含了新标准,但我确保,优雅的降级会发生。符合标准的浏览器可以获得完整的体验。年长的人在提供工作页面的同时,获得的视觉效果更少。

I am developing for all major browsers out there (IE 6+, Firefox 3+, current Safari, Chrome, Opera 9.5+). My main advice to keeping code clean and eliminating extreme hacking sessions is the following: Test your page simultaneously in all Browsers. It is a lot easier to fix multiple small Problems than fixing a complete page in a single pass. Style issues are really easy to fix when working this way. JavaScript is a bit more challenging, but still much easier when working like this. jQuery often helps with this kind of problems. I include the new standards here and there but i am making sure, that graceful degration takes place. Standards compliant browsers get the full experience. Older ones get less eye candy while still delivering a working page.

萌梦深 2024-09-25 20:27:29
  1. 了解标准。
  2. 按照标准编写代码。
  3. 在流行的浏览器中测试代码,看看哪里出错了。

“标准”是 HTML、CSS、JavaScript 和 DOM。 jQuery 在消除浏览器之间的 JavaScript 和 DOM 不一致方面做了很多工作,并且在我看来,它是一个更好的 DOM 接口。

在撰写本文时,“流行浏览器”包括 IE 6-8、Firefox 3 以及最新版本的 Safari、Chrome 和 Opera。 Safari 和 Chrome 几乎没有任何差异,因为它们使用相同的渲染引擎,而 Safari、Chrome、Opera 和 Firefox 几乎没有任何差异,因为它们都是关于标准的。

一想到跨浏览器兼容性问题,我就感到畏缩。

他们真的没那么糟糕。 (当你忽略 IE 时。当你遇到它的问题时,至少可以通过 Google 搜索到它们。)

  1. Learn the standards.
  2. Write code according to the standards.
  3. Test the code in popular browsers, and see where it breaks.

“The standards” are HTML, CSS, JavaScript and the DOM. jQuery does a lot to smooth out JavaScript and DOM inconsistencies between browsers, and is a bit of a nicer interface to the DOM in my opinion.

“Popular browsers” at the time of writing are IE 6–8, Firefox 3, and the latest versions of Safari, Chrome and Opera. Safari and Chrome have hardly any differences as they use the same rendering engine, and Safari, Chrome, Opera and Firefox have very few differences as they’re all about the standards.

I cringe at the thought of cross browser compatibly issues.

They‘re really not that bad. (When you ignore IE. And its issues are at least reasonably Googleable when you encounter them.)

梦过后 2024-09-25 20:27:29

我认为从一组良好的默认值开始并遵循最佳实践很重要,使用不同的浏览器并不麻烦。我在 http://html5boilerplate.com 上工作,所以我们在那里有一个链接列表(以及实际的样板文件)这使得网络开发人员的工作变得更加容易。

I think it is important you start with a good set of defaults and follow best practices, it is not much of a hassle to work with deviating browsers. I worked on http://html5boilerplate.com so we have a list of links up there (along with the actual boilerplate) that make a web developer's job much easier.

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