HTML5在结构和语法上做了大量的简化。当然,也提供了语义化的标签

结构上区别:

  1.简化了文档声明语句     HTML5仅规定了一种:       <!DOCTYPE html>

  2.简化了设置字符编码   <meta charset="UTF-8">

    charset 属性是 HTML5 中的新属性,且替换了:<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

语法区别:
  1.省略了一些标签:

    全部省略: html   body  head  tbody

        在实际编码中,不建议省略像 html body head元素。一是习惯上无法接受;二是看着别扭

    省略结束标签:

      li     p    ( dl  dt)      (tr   th   td   thead   tbody   tfoot    table表单)         option

    可以不闭合的空标签:

       br  img  hr   input   link  meta

  2.具有boolean值属性

    checked  selected  disabled

    HTML5中    <input    type="checkbox"  checked >    或者  <input    type="checkbox"  checked="" />   都是ok的

    HTML4        <input    type="checkbox"  checked="true"   />     <input    type="checkbox"  checked="false"  />    后面的赋值不可以省略

  3.省略引号

    <input    type = radio >       语法上是ok的, 在不考虑兼容的情况下。建议带上引号

  4.忽略大小写

    在HTML5中是忽略大小写的       <INPUT  type="Radio">      引擎是可以正确编译的

================完结======================

  (补充上一篇的, 图文混排  HTML5新增了  figure  元素。    功能类似于  dl结构

  figure:     标签规定独立的流内容(图像、图表、照片、代码等等) 

       元素的内容应该与主内容相关,同时元素的位置相对于主内容是独立的。如果被删除,则不应对文档流产生影响。

    <figure>
      <img src="img_pulpit.jpg" tppabs="http://w3schools.com/tags/img_pulpit.jpg" alt="The Pulpit Rock" width="304" height="228">
    </figure>

  figcaption:  为figure元素定义标题

       放在figure元素的第一个或最后一个子元素的位置

  <figure>
    <img src="img_pulpit.jpg" alt="The Pulpit Rock" width="304" height="228">  
    <figcaption>Fig.1 - A view of the pulpit rock in Norway.</figcaption>
  </figure>

  

  

最新文章

  1. 冲刺一 (Day 2)
  2. three.js 显示一条线
  3. C++ Primer : 第十三章 : 拷贝控制示例
  4. Scene视图辅助线绘制
  5. 一次tomcat服务器被入侵解决办法
  6. goldengate 12c 针对oracle 12c配置的主要变化
  7. iOS程序崩溃*** Terminating app due to uncaught exception &#39;CALayerInvalidGeometry&#39;, reason: &#39;CALayer position contains NaN: [37.5 nan]&#39;
  8. Paint House II 解答
  9. Assertion failure in -[UIView layoutSublayersOfLayer:]
  10. IT团队管理
  11. Digilent Xilinx USB Jtag cable
  12. C# int数组转string字符串
  13. MT【280】最小值函数
  14. Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column &#39;information_schema.PROFILING.SEQ&#39; which is not functionally dependent on columns in GROUP BY clause; this
  15. 501. Find Mode in Binary Search Tree【LeetCode by java】
  16. 4种PHP回调函数风格
  17. 【转】Ultra simple ISO-7816 Interface
  18. python opencv3 基于ORB的特征检测和 BF暴力匹配 knn匹配 flann匹配
  19. ECharts饼图制作分析
  20. Redis2.8.7配置文件说明

热门文章

  1. 关于ESP8266 NodeCMU固件无法刷入新代码的解决方法
  2. web三要素
  3. 常用crud
  4. Gitlab的介绍
  5. 使用ABAP Data Validator验证数据有效性
  6. 「扫盲」Elasticsearch
  7. (转自360安全客)深入理解浏览器解析机制和XSS向量编码
  8. Go的切片:长度和容量
  9. API文档自动生成,Swagger的配置
  10. Python PE8编程规范