[html]span里面放div会带来严重问题

If you use the W3C Validator to check a simple document:

<!DOCTYPE html> 
<html lang="en">    
<head>      
 <title>Title</title>      
 <meta charset="utf-8">    
</head>   
<body>      
<span>         
    <div><p>Some text</p></div>         Some text      
</span>   
</body></html>

it does not report an error when validating it as HTML5. If you set the doctype to "HTML 4.01 Transitional" it does. Perhaps this is just because the HTML5 validation is experimental?
The html5.validator.nu service does report an error however

参考文献

  1. http://stackoverflow.com/questions/2919909/nesting-div-within-span-problem
  2. http://diophung.blogspot.jp/2014/03/web-developer-conform-to-w3c-standards.html
  3. http://doctype.com/span-contain-div-html5
  4. https://www.w3.org/wiki/Generic_containers_-_the_div_and_span_elements
  5. https://www.w3.org/TR/html401/struct/global.html#h-7.5.3
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • HTML、XML、XHTML有什么区别? XMLXML是The Extensible Markup Languag...
    zx9426阅读 3,199评论 0 1
  • 1. 浏览器页面有哪三层构成,分别是什么,作用是什么? 构成:结构层、表示层、行为层分别是:HTML、CSS、Ja...
    程序猿人王小贱阅读 5,866评论 1 11
  • 问答题47 /72 常见浏览器兼容性问题与解决方案? 参考答案 (1)浏览器兼容问题一:不同浏览器的标签默认的外补...
    _Yfling阅读 14,687评论 1 92
  • #成都美食# 我的深夜成都美食小课堂又要开课了… 毕竟昨天被明星大侦探恐怖童谣吓得不轻… 今天一定得吃些好的犒劳一...
    卜默笙阅读 3,459评论 0 2
  • 恰到好处的喜欢最舒服 懂分寸的人最迷人
    冰頔阅读 754评论 0 0