w3c检验时出现的两个问题以及解决_html/css_WEB-ITnose
程序员文章站
2022-04-29 12:17:55
...
先看看解决的成果吧
检验网站: http://validator.w3.org/
Warning Byte-Order Mark found in UTF-8 File.The Unicode Byte-Order Mark (BOM) in UTF-8 encoded files is known to cause problems for some text editors and older browsers. You may want to consider avoiding its use until it is better supported.
(翻译: 带有BOM的UTF-8编号的文件在旧式浏览器会有一些问题。建议你使用别的编码格式以达到更好的兼容。。。渣渣的我乱翻译的。。不知道有没有误导人。。。有功底的人直接看英文吧。。呵呵)
解决办法: 使用 Notepad++ 或者别的编辑器 (不知道vim可以吗?小弟不知。。知道的麻烦告诉我~), 将编码改成没有BOM的UTF-8编码
document type does not allow element "input" heremissing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag
(翻译: 元素需要在 "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" 这些元素的里面)
比如说,
1
上面那是错误的, 不过只需要用
另外, 在xhtml中, 所有标签都需要闭合。 比如说, , 比如说,