这个简约的HTML5标记是否有效? [英] Is this minimalist HTML5 markup valid?

查看:127
本文介绍了这个简约的HTML5标记是否有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<!DOCTYPE html>
<meta charset="utf-8">
<body>
Hello, world!

代码来源

SOURCE FOR CODE

如果是这样,除了删除Hello,world!有没有任何标签可以删除它仍然有效,你怎么知道它仍然有效?

If so, besides removing "Hello, world!" is there any tag that's able to be removed and it still be valid, and how do you know it's still valid?

推荐答案

它是无效。要检查它,您可以在 W3C Validator 中运行它

It's not valid. To check it you can run it in W3C Validator

错误是:元素头缺少必需的子元素标题实例。

...

更新

vcsjones 声明头部元素是可选的。这就是标题一个是必需的。感谢 mootinator ,指出 body 也是可选的。

As vcsjones stated the head element is optional. That's the title one is required. Credit to mootinator for pointing out that the body is also optional.

最简单的有效文件将是:

So the simplest valid document will be:

<!DOCTYPE html>
<title></title>

这篇关于这个简约的HTML5标记是否有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆