用严格的html而不是transitionl html编写网站是否被认为更专业?
我想知道用严格的 xhtml 编写网站是否比过渡性的更专业。
这是作为一名 Web 开发人员在进步时应该做的事情,还是无关紧要的事情?
I was wondering if it was considered more professional to write a website in strict xhtml rather than transitional.
Is it something that should be done as you advance as a web developer, or is it irrelevant?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
除了(很少需要的)
start
属性之外,严格型和过渡型之间的区别归结为“自从 Netscape 4 不再成为主流浏览器以来您不应该使用的东西”。所以,这个问题是一个棘手的问题,因为如果你在新世纪这一年学习了 HTML,你一开始就不应该使用 Transitional(现在让我们默哀一分钟,因为我们感叹过度流行的 HTML 质量很差)教程(例如来自某个组织的教程,该组织因其相似的名称而在 W3C 上获得了很多荣耀……我正在咆哮,所以我现在就停止)。
With the possible exception of the (rarely needed)
start
attribute, the difference between Strict and Transitional boils down to "Things you should not have used since Netscape 4 stopped being a dominant browser".So, the question is a tricky one as, if you learned HTML this side of the millennium, you shouldn't have been using Transitional in the first place (now let us have a minutes silence as we lament the poor quality of over-popular tutorials (such as one from an organization that gets a lot of glory reflected off the W3C due to its similar name … and I'm ranting, so I'll stop now).
在营销方面,如果您说您使用严格的 XHTML,您可能会得到稍微好一点的回应,但实际上,选择并不重要。 Transitional 有一些怪癖,可以提高与 HTML4 及更早版本元素的向后兼容性,但后来这些怪癖就不再受欢迎,因此在严格风格(例如框架)中已被弃用。如果您最近正在学习如何编写标记,那么您无论如何都在学习所有 XHTML,因此您可以随意使用 strict。
简短的回答:没关系。
On the marketing side, you might get a slightly better response for saying that you right in strict XHTML, but really, the choice doesn't matter. Transitional has some quirks that improve backwards compatibility with elements from HTML4 and older, but which have since been disfavoured and thus deprecated in the strict flavours (e.g., frames). If you're learning how to write markup these days, you're learning all XHTML anyway, so you can feel free to use strict.
Short answer: it doesn't matter.
您使用的内容并没有太大区别 - 只需尝试尽可能与您的标记保持一致即可。如果不出意外的话,它会让搜索+替换变得更加容易。
It doesn't make much of a difference which you use - just try to be as consistent as possible with your mark-up. If nothing else, it makes search+replace much easier.
如果您想变得“专业”并了解最新情况,请使用
。这不会破坏任何东西,而且它是你能得到的最现代的。
If you want to be "professional" and up-to-date use
<!DOCTYPE html>
. This won't break anything and it's as modern as you can get.我编写 HTML 4.01,无论是传统的还是严格的。
事实是 XHTML 已被破坏,在 HTML 4.01 浏览器上正确呈现将在您的页面中出现直角括号。
如果您认为您知道如何
是在 HTML 4 标准中定义的,请再考虑一下。
当由严格的解析器读取时,
HTML 所基于的 SGML 语言形式具有称为 NET 的短标签功能。转换为“
“
”。所以,“
”烧伤。
I write HTML 4.01, either traditional or strict.
The truth is XHTML is broken and a correct rendering on a HTML 4.01 browser will litter your page with right angle brackets.
If you think you know how <br/> is defined in the HTML 4 standard, think again.
When read by a strict parser becomes
The SGML language form which HTML is built on has a shorttag feature known as NET. The transformation is "<br /" -> "<br></br>". So, "<br/>" burns.
这是我昨天找到的一篇文章。阅读标记部分,它是第一部分:D
http://davidwalsh.name/get-over-it
Here is an article I found yesterday. Read the markup part, its the first part :D
http://davidwalsh.name/get-over-it