【问题标题】:How to ensure my doctype is XHTML 1.0 Strict如何确保我的文档类型是 XHTML 1.0 Strict
【发布时间】:2014-09-04 01:27:14
【问题描述】:

在处理 XHTML 1.0 Strict 页面时,我发现 iframe 已被弃用。我做了一些研究,并将其替换为object 标签。

<object id="gmap" type="text/html" data="https://maps.google.ca/maps/ms?msa=0&amp;msid=216725582357492079329.0004cf99c633289e8b190&amp;hl=en&amp;ie=UTF8&amp;t=m&amp;ll=34.870479,-40.172607&amp;spn=34.201734,120.673828&amp;output=embed"></object>

它经过验证,但作为 HTML 4.0 过渡。如何将其验证为 XHTML 1.0 Strict?

【问题讨论】:

  • 请也添加您的代码...会更好

标签: xhtml maps markup doctype transitional


【解决方案1】:

W3C 验证器不会验证嵌入在 iframeobject 标记中的内容。如果您想知道如何使其成为 XHTML 1.0 Strict,请从有效的 XHTML 1.0 Strict 文档开始,例如:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Example</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
</head>
<body>
    <div><object data="http://example.com"></object></div>
</body>
</html>

然后添加您的标记而不使其无效。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-29
    相关资源
    最近更新 更多