文档类型声明之前的元关键字?

发布于 2024-11-10 08:08:44 字数 422 浏览 0 评论 0原文

我最近浏览了当地一家网页设计公司的产品组合,发现他们所有网站的代码都是这样开头的:

<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 技术交流群。

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

发布评论

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

评论(2

哑剧 2024-11-17 08:08:44

这是一种糟糕的做法,并且是无效的 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...

相守太难 2024-11-17 08:08:44

仅供参考 - 刚刚遇到此问题,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.

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