📜  HTML 和 HTML5 的区别

📅  最后修改于: 2021-10-29 06:10:44             🧑  作者: Mango

HTML代表超文本标记语言。它用于使用标记语言设计网页。 HTML 是超文本和标记语言的结合。超文本定义了网页之间的链接。标记语言用于在定义网页结构的标签内定义文本文档。这种语言用于注释(在计算机注释处)文本,以便机器可以理解它并相应地处理文本。大多数标记(例如 HTML)语言都是人类可读的。该语言使用标签来定义必须对文本进行哪些操作。它用于构建和呈现网页上的内容。 HTML5 是 HTML 的第五个版本。许多元素从 HTML5 中删除或修改。

HTML 和 HTML5 之间存在许多差异,下面将讨论:

HTML HTML5
It didn’t support audio and video without the use of flash player support. It supports audio and video controls with the use of
It uses cookies to store temporary data. It uses SQL databases and application cache to store offline data.
Does not allow JavaScript to run in browser. Allows JavaScript to run in background. This is possible due to JS Web worker API in HTML5.
Vector graphics is possible in HTML with the help of various technologies such as VML, Silver-light, Flash, etc. Vector graphics is additionally an integral a part of HTML5 like SVG and canvas.
It does not allow drag and drop effects. It allows drag and drop effects.
Not possible to draw shapes like circle, rectangle, triangle etc. HTML5 allows to draw shapes like circle, rectangle, triangle etc.
It works with all old browsers. It supported by all new browser like Firefox, Mozilla, Chrome, Safari, etc.
Older version of HTML are less mobile-friendly. HTML5 language is more mobile-friendly.
Doctype declaration is too long and complicated. Doctype declaration is quite simple and easy.
Elements like nav, header were not present. New element for web structure like nav, header, footer etc.
Character encoding is long and complicated. Character encoding is simple and easy.
It is almost impossible to get true GeoLocation of user with the help of browser. One can track the GeoLocation of a user easily by using JS GeoLocation API.
It can not handle inaccurate syntax. It is capable of handling inaccurate syntax.
Attributes like charset, async and ping are absent in HTML. Attributes of charset, async and ping are a part of HTML 5.

有许多 HTML 元素已被修改或从 HTML5 中删除。其中一些如下所列:

Element In HTML5
Changed to
Changed to
Changed to
    Removed
    Removed
    </td> <td>Removed</td> </tr> <tr> <td><strike></td> <td>No new tag. CSS is used for this</td> </tr> <tr> <td><big></td> <td>No new tag. CSS is used for this</td> </tr> <tr> <td><basefont></td> <td>No new tag. CSS is used for this</td> </tr> <tr> <td><font></td> <td>No new tag. CSS is used for this</td> </tr> <tr> <td><center></td> <td>No new tag. CSS is used for this</td> </tr> <tr> <td><tt></td> <td>No new tag. CSS is used for this</td> </tr> </table> <p> HTML5 中添加了许多新元素,例如导航、音频、figcaption、进度、命令、时间、数据列表、视频、图形、仪表、数据、部分、时间、旁白、画布、摘要、rp、rt、详细信息、wbr、标题、页脚、注册机、嵌入、文章、hgroup、bdi、标记、输出、源、轨道、部分、ruby 等等。</p> <p> HTML 是网页的基础,用于通过构建网站和 Web 应用程序进行网页开发。您可以按照此 HTML 教程和 HTML 示例从头开始学习 HTML。</p> </div> </article> </div> </div> </div> </div> </div> <footer> <div class="bg-white text-center pb-1"> <p class="text-body-tertiary pt-3 lh-lg text-opacity-50" id="footer-text">Copyright &copy; 2020 - 2024 版权所有 <br> <a href="https://beian.miit.gov.cn/" target="_blank" class="text-opacity-50 text-body-tertiary mt-1 mb-1">蜀ICP备20006366号-1</a> <br> Made with ❤️ in Chengdu </p> </div> </footer> <!-- 引入Bootstrap JavaScript库 --> <script src="https://unpkg.com/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script> <!-- 引入Meilisearch搜索相关的JavaScript库 --> <script src="https://cdn.jsdelivr.net/npm/@meilisearch/instant-meilisearch/dist/instant-meilisearch.umd.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/instantsearch.js@4"></script> <script src="https://www.imangodoc.com/static/javascript/meili_custom.js"></script> <!-- 引入prismjs代码高亮相关的JavaScript库 --> <script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-core.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/toolbar/prism-toolbar.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/autoloader/prism-autoloader.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js"></script> </body> </html>