如果我们的代码对于 Transtional doctype 有效,我们是否应该使用严格的 doctype?
如果我们的代码在使用过渡 doctype 的 W3C 验证中有效,那么使用过渡 doctype 与表示性或已弃用的元素有什么缺点?
对于我们使用 XHTML/HTML 转换文档类型的网站,几年后我们是否必须再次重写/编辑网站的代码?
这不是语义,而是使用较少的字符,并且在 CMS 中使用基于 Web 的所见即所得编辑器会很好,
small {font-size:9px}
<p>hello <small>how</small> are you?</p>
但是使用更多的字符
.small-text {font-size:9px}
<p>hello <span class="small-text">how</span> are you?</p>
都将得到验证,并且在所有当前浏览器中都支持。但什么对未来最好?为什么?
What are cons to use transitional doctype with presentational or deprecated element, if our code is valid in W3C validation with transitional doctype?
Will we have to rewrite/edit site's code again after few years for the site's in which we are using XHTML/HTML transtional doctype.?
This is not semantic but using less character, and it wold be good in to use web based WYSIWYG editor in CMS
small {font-size:9px}
<p>hello <small>how</small> are you?</p>
but this using more character
.small-text {font-size:9px}
<p>hello <span class="small-text">how</span> are you?</p>
both will be validated and both has support in all current browsers. but what will be the best for future and why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只要您指定过渡文档类型,而不是简单地使用过渡元素,我认为您不会遇到任何重大问题,除非浏览器本身开始放弃对这些元素的支持。还值得注意的是,您可能会限制自己可以使用哪些元素,因为随着严格文档类型的发展,过渡文档类型可能会保持静态。
不过,我认为您不会面临任何重大问题,几年之内肯定不会。大多数网站(当然是商业网站)可能需要进行修改(如果只是出于营销/品牌原因),然后才能使用过渡性内容成为问题。
So long as you specify the transitional doctype, rather than simply using the transitional elements, I don't think you'll run across any great issues unless the browsers themselves start to drop support for those elements. It's also worth noting that you may be limiting yourself as regards which elements you can use as the transitional doctype is likely to remain static as the strict doctypes evolve.
I don't think you're facing any huge issues, though, certainly not inside of a few years. And most sites, certainly commercial, would probably need to be revised -if only for marketing/branding reasons- before the use of
transitional
becomes a problem.