文档类型声明之前的元关键字?
我最近浏览了当地一家网页设计公司的产品组合,发现他们所有网站的代码都是这样开头的:
<meta name="keywords" content="a whole bunch of keywords for their site">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
...
我能够确定这些页面是由 Dreamweaver 生成的(至少部分是由 Dreamweaver 生成的)。
Dreamweaver 是这样做的,还是他们的“开发人员”只是将代码粘贴到文档顶部。
我的冲动是,这是一种不好的做法,它可能在某些平台上无法正常工作,但这让我想知道它们是否可能是造成这种情况的原因?
I recently was browsing a local web design firm's portfolio and found all their sites' code begins as such:
<meta name="keywords" content="a whole bunch of keywords for their site">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
...
I was able to determine that the pages were generated by dreamweaver (at least in part).
Did dreamweaver do this, or did their "developer" just paste the code at the top of the document.
It is my impulse that this is bad practice and it might work incorrectly on some platforms but it got me wondering as to whether or not their may be a reason for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一种糟糕的做法,并且是无效的 HTML。我敢打赌这会让 IE 直接进入怪异模式。
但至于您的问题,要么开发人员是脚本小子,在对结果知之甚少的情况下将
标签推入其中,要么 Dreamweaver 做到了。我希望这是 Dreamweaver...
That is a terrible practice and invalid HTML. I bet that this would throw IE directly into quirks mode.
But as for your question, either the developer is a script kiddie and shoved the
<meta>
tag in there with little knowledge of the outcomes, or Dreamweaver did it. I hope it was Dreamweaver...仅供参考 - 刚刚遇到此问题,Dreamweaver 不会自动将元标记放在正确的位置。光标必须事先放置在可编辑区域中。
FYI - just had this issue and Dreamweaver does not put the meta tags in the correct position automatically. Cursor must be placed beforehand into an editable region.