在成都做网站、成都建网站,成都网站建设及网页制作,首选领城互动
  • 首页
  • 关于我们
  • 服务范围
  • 经典案例
  • 联系我们
当前位置:首页 > 服务项目 > 成都网站建设 > 现阶段html5跟html4的十个主要区别

现阶段html5跟html4的十个主要区别

HTML5是最新的HTML规范,或迟或早,一切的web顺序员都邑发现需求运用到这个最新的规范,并且,良多人都觉得,从新设计一个HTML5的网站,要比把一个网站从HTML4搬迁到HTML5上容易的多,这是由于这两个版本之间有很大不同之处。

现实上,HTML5并没有对HTML4做什么太多的修正,它们很多地方都是类似的。


1. HTML5标准还在制定中

这头一个分歧之处不言而喻,但十分主要,我需求先从它开端。也许你曾经留意到了关于HTML5很酷的信息到处都是,然则现实状况是,HTML5是一个还未完成的规范。HTML410岁了,但它仍是当时正式的规范的现实没有变。

另一方面,HTML5仍处在早期阶段,今后的修正会不时的呈现。你必需思索到这些,由于你在网站上运用的这些新添加或修正的网页元素会每年都呈现一些转变,你需求一直的更新晋级你的网站,这可不是你但愿的。这就是当前为止,你最好在产物里运用HTML4,只在实行里运用HTML5的缘由。

2. 简化的语法

更简单的doctype声明是HTML5里众多新特征之一。现在你只需要写<!doctype html>,这就行了。HTML5的语法兼容HTML4和XHTML1,但不兼容SGML。

3.  <canvas> 标记替代Flash

对于Web用户来说,Flash既是一个惊喜,也是一种痛苦。有很多的Web开发人员对HTML5对Flash产生的威胁很不满。但对于那些忍受着要花几年时间加载和运行的臃肿的Flash视频的人来说,用新的 <canvas> 标记生成视频的技术已经到来。

目前, <canvas> 标记并不能提供所有的Flash具有的功能,但假以时日,Flash必将从web上淘汰。我们拭目以待,因为很多人还并不认同这种观点。

4. 新的 <header> 和 <footer> 标记

HTML5的设计是要更好的描绘网站的解剖结构。这就是为什么这些<header> 和
<footer> 等新标记的出现,它们是专门为标志网站的这些部分设计的。

在开发网站时,你不在需要用<div>标记来标注网页的这些部分。

5. 新的 <section> 和 <article> 标记

跟<header> 和 <footer>标记类似,HTML5中引入的新的<section> 和 <article> 标记可以让开发人员更好的标注页面上的这些区域。

据推测,除了让代码更有组织外,它也能改善SEO效果,能让搜索引擎更容易的分析你的页面。

6. 新的 <menu> 和 <figure> 标记

新的<menu>标记可以被用作普通的菜单,也可以用在工具条和右键菜单上,虽然这些东西在页面上并不常用。

类似的,新的 <figure> 标记是一种更专业的管理页面上文字和图像的方式。当然,你可以用样式表来控制文字和图像,但使用HTML5内置的这个标记更适合。

7. 新的 <audio> 和 <video> 标记

新的<audio> 和 <video> 标记可能是HTML5中增加的最有用处的两个东西了。正如标记名称,它们是用来嵌入音频和视频文件的。

除此之外还有一些新的多媒体的标记和属性,例如<track>,它是用来提供跟踪视频的文字信息的。有了这些标记,HTML5使Web2.0特征变得越来越友好。问题在于,在HTML5还未被广泛的接受之前,Web2.0还是老的Web2.0。

8.新的 <form> 和 <forminput>

新的 <form> 和 <forminput> 标记对原有的表单元素进行的全新的修改,它们有很多的新属性(以及一些修改)。如果你经常的开发表单,你应该花时间更详细的研究一下。

9. 废除 <b> 和 <font> 标记

对我个人来说,这是一个让我不太理解的改动。我并不认为去除 <b> 和 <font>标记会带来多大的好处。我知道,官方的指导说这些标记可以通过CCS来做更好的处理,但这样一来,为了在文章一两个地方出现的这种标记,你就需要在独立的css和文本两个地方来实现这一的功能,岂不笨拙。也许我们以后会习惯这种方法。

10. 废除 <frame>, <center>, <big> 标记

现实上,我曾经记不清曾经何时用过这些标志了,所以,我并不为去除这些标志觉得难过。一样的缘由,有更好的标志能完成它们的功用——这很好,任何作废的标志从规范中剔除都是受欢迎的。

这10个HTML5和HTML4之间的分歧只是整个新的标准中的一小局部。除了这些首要的变化外,我还可以略提一下一些非必须的改动,比方修正了标志的属性,让它可以倒排序,对标志也做了修正。一切这些非必须的改动数目很多。并且新的修正也在不时的添加,因而,假如你想及时跟踪最新的意向,你需求常常的检查w3.org的HTML4 和 HTML5之间的分歧这个页面。假如你很心急,想在你的任务中运用这些新的标志和属性,我劝说你最好只是做实行,缘由曾经说的很清晰了,这些新标志和新属性在未来也许会有很大的改动,所以,除非你不时的更新你的代码,它们很能够会过时掉效。虽然现在大大都盛行的阅读器的最新版都支撑HTML5,但有些新的(或修正的)标志和属性它们并不支撑,所以你的网页在用户的屏幕上有能够前后显示的纷歧致。耐性等候,等候HTML5真正可以适用时分。当前还不是时分。

    电话:028-85030041
    地址:中国成都新希望国际A座
    ©Linking 2006-2021 Inc.
    蜀ICP备12000250号-1
Process: 0.049s ( Load:0.006s Init:0.015s Exec:0.023s Template:0.006s ) | DB :13 queries 0 writes | UseMem:2,087 kb
页面Trace信息
当前页面 : /web/201111/91.html
模板缓存 : C:\wwwroot\www.citycy.com/data/front/runtime/cache/351ab735e880a1dd5f3567d38b061acb.php
请求方法 : GET
通信协议 : HTTP/1.1
请求时间 : 2023-01-28 12:35:09
用户代理 : CCBot/2.0 (https://commoncrawl.org/faq/)
会话ID : 9iemeqqrincrpgecsrqggfq8k4
日志记录 : 61条日志
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8192] mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead DbMysql.class.php 第 62 行.
[ 2023-01-28T12:35:09+08:00 ] SQL: RunTime:0.000556s SQL = SHOW COLUMNS FROM citycy_category
[ 2023-01-28T12:35:09+08:00 ] SQL: RunTime:0.000089s SQL = SELECT `catid` FROM `citycy_category` WHERE `catdir`='web' LIMIT 1
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8192] preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead functions.php 第 118 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [2048] Only variables should be assigned by reference FbaseAction.class.php 第 68 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: forward FbaseAction.class.php 第 69 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8192] preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead common.php 第 79 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: userdata FbaseAction.class.php 第 105 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: userdata FbaseAction.class.php 第 105 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [2048] Declaration of ContentModel::add() should be compatible with Model::add($data = '', $options = Array) ContentModel.class.php 第 507 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [2048] Declaration of ContentModel::delete() should be compatible with Model::delete($options = Array) ContentModel.class.php 第 507 行.
[ 2023-01-28T12:35:09+08:00 ] SQL: RunTime:0.000487s SQL = SHOW COLUMNS FROM citycy_content
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8192] mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. DbMysql.class.php 第 400 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8192] mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. DbMysql.class.php 第 400 行.
[ 2023-01-28T12:35:09+08:00 ] SQL: RunTime:0.000367s SQL = SELECT `cid` FROM `citycy_content` WHERE ( `url` = '201111/91.html' ) AND ( `status` = '9' ) LIMIT 1
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8192] mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. DbMysql.class.php 第 400 行.
[ 2023-01-28T12:35:09+08:00 ] SQL: RunTime:0.000302s SQL = SELECT * FROM `citycy_content` WHERE ( `url` = '201111/91.html' ) LIMIT 1
[ 2023-01-28T12:35:09+08:00 ] SQL: RunTime:0.000361s SQL = SHOW COLUMNS FROM citycy_content_article
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8192] mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. DbMysql.class.php 第 400 行.
[ 2023-01-28T12:35:09+08:00 ] SQL: RunTime:0.001571s SQL = SELECT * FROM `citycy_content_article` WHERE ( `cid` = '91' ) LIMIT 1
[ 2023-01-28T12:35:09+08:00 ] SQL: RunTime:0.000412s SQL = SHOW COLUMNS FROM citycy_model_field
[ 2023-01-28T12:35:09+08:00 ] SQL: RunTime:0.000082s SQL = SELECT `fieldid` FROM `citycy_model_field` WHERE `status`='1' AND `modelid`='1'
[ 2023-01-28T12:35:09+08:00 ] SQL: RunTime:0.000347s SQL = SHOW COLUMNS FROM citycy_content_tag
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8192] mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. DbMysql.class.php 第 400 行.
[ 2023-01-28T12:35:09+08:00 ] SQL: RunTime:0.000172s SQL = SELECT citycy_tag.name FROM `citycy_content_tag` LEFT JOIN citycy_tag ON (citycy_tag.tagid=citycy_content_tag.tagid) WHERE ( citycy_content_tag.keyid = 'c-91' ) ORDER BY citycy_tag.tagid DESC
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [2] Invalid argument supplied for foreach() ContentModel.class.php 第 416 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined variable: value Field.class.php 第 199 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined variable: value Field.class.php 第 197 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined variable: value Field.class.php 第 197 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [2] strpos(): Empty needle ThumbField.class.php 第 21 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined variable: value Field.class.php 第 197 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined variable: value Field.class.php 第 197 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined variable: value Field.class.php 第 197 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined variable: value Field.class.php 第 197 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined variable: value Field.class.php 第 197 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined index: p FbaseAction.class.php 第 262 行.
[ 2023-01-28T12:35:09+08:00 ] SQL: RunTime:0.000094s SQL = SELECT * FROM `citycy_content` WHERE sort<1 AND catid=10 ORDER BY sort DESC LIMIT 1
[ 2023-01-28T12:35:09+08:00 ] SQL: RunTime:0.000083s SQL = SELECT * FROM `citycy_content` WHERE sort>1 AND catid=10 ORDER BY sort ASC LIMIT 1
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [2] Missing argument 1 for Ad::__construct(), called in C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Common\functions.php on line 259 and defined Ad.class.php 第 40 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [2] Missing argument 2 for Ad::__construct(), called in C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Common\functions.php on line 259 and defined Ad.class.php 第 40 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined variable: type Ad.class.php 第 41 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined variable: setting Ad.class.php 第 42 行.
[ 2023-01-28T12:35:09+08:00 ] NOTIC: [8] Undefined variable: html Ad.class.php 第 136 行.
加载文件 : 76
[0] => C:\wwwroot\www.citycy.com\index.php
[1] => C:\wwwroot\www.citycy.com\define.php
[2] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\ThinkPHP.php
[3] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Common\runtime.php
[4] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Common\defines.php
[5] => C:\wwwroot\www.citycy.com\front\Conf\paths.php
[6] => C:\wwwroot\www.citycy.com\front\Conf\core.php
[7] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Common\functions.php
[8] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Lib\Think\Core\Think.class.php
[9] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Lib\Think\Exception\ThinkException.class.php
[10] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Lib\Think\Core\Log.class.php
[11] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Lib\Think\Core\App.class.php
[12] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Lib\Think\Core\Action.class.php
[13] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Lib\Think\Core\View.class.php
[14] => C:\wwwroot\www.citycy.com\front\Common\alias.php
[15] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Common\convention.php
[16] => C:\wwwroot\www.citycy.com\front\Conf\config.php
[17] => C:\wwwroot\www.citycy.com\data\config.inc.php
[18] => C:\wwwroot\www.citycy.com\data\config.cache.php
[19] => C:\wwwroot\www.citycy.com\front\Common\common.php
[20] => C:\wwwroot\www.citycy.com\front\Conf\routes.php
[21] => C:\wwwroot\www.citycy.com\front\Conf\tags.php
[22] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Common\debug.php
[23] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Lib\Think\Core\Model.class.php
[24] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Lib\Think\Db\Db.class.php
[25] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Lib\Think\Db\Driver\DbMysql.class.php
[26] => C:\wwwroot\www.citycy.com\data\cache\category_10.php
[27] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Lang\zh-cn.php
[28] => C:\wwwroot\www.citycy.com\front\Lib\Action\FcontentAction.class.php
[29] => C:\wwwroot\www.citycy.com\front\Lib\Action\FbaseAction.class.php
[30] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Lib\ORG\Util\Input.class.php
[31] => C:\wwwroot\www.citycy.com\include\Auth.class.php
[32] => C:\wwwroot\www.citycy.com\include\Act.class.php
[33] => C:\wwwroot\www.citycy.com\data\cache\front_act_cache.php
[34] => C:\wwwroot\www.citycy.com\front\Lib\Model\ContentextModel.class.php
[35] => C:\wwwroot\www.citycy.com\admin\Lib\Model\ContentModel.class.php
[36] => C:\wwwroot\www.citycy.com\include\Pager.class.php
[37] => C:\wwwroot\www.citycy.com\data\cache\model_1.php
[38] => C:\wwwroot\www.citycy.com\data\cache\modelField_1.php
[39] => C:\wwwroot\www.citycy.com\data\cache\modelField_2.php
[40] => C:\wwwroot\www.citycy.com\data\cache\modelField_4.php
[41] => C:\wwwroot\www.citycy.com\data\cache\modelField_6.php
[42] => C:\wwwroot\www.citycy.com\data\cache\modelField_7.php
[43] => C:\wwwroot\www.citycy.com\data\cache\modelField_8.php
[44] => C:\wwwroot\www.citycy.com\data\cache\modelField_9.php
[45] => C:\wwwroot\www.citycy.com\data\cache\modelField_10.php
[46] => C:\wwwroot\www.citycy.com\data\cache\modelField_11.php
[47] => C:\wwwroot\www.citycy.com\data\cache\modelField_12.php
[48] => C:\wwwroot\www.citycy.com\data\cache\modelField_13.php
[49] => C:\wwwroot\www.citycy.com\data\cache\modelField_14.php
[50] => C:\wwwroot\www.citycy.com\data\cache\modelField_15.php
[51] => C:\wwwroot\www.citycy.com\data\cache\modelField_16.php
[52] => C:\wwwroot\www.citycy.com\data\cache\modelField_20.php
[53] => C:\wwwroot\www.citycy.com\data\cache\modelField_21.php
[54] => C:\wwwroot\www.citycy.com\include\Field.class.php
[55] => C:\wwwroot\www.citycy.com\include\field\CatidField.class.php
[56] => C:\wwwroot\www.citycy.com\include\field\TitleField.class.php
[57] => C:\wwwroot\www.citycy.com\include\field\InputField.class.php
[58] => C:\wwwroot\www.citycy.com\include\field\ThumbField.class.php
[59] => C:\wwwroot\www.citycy.com\include\field\AttrField.class.php
[60] => C:\wwwroot\www.citycy.com\include\field\TextareaField.class.php
[61] => C:\wwwroot\www.citycy.com\include\field\EditorField.class.php
[62] => C:\wwwroot\www.citycy.com\include\Keylink.function.php
[63] => C:\wwwroot\www.citycy.com\include\field\BoxField.class.php
[64] => C:\wwwroot\www.citycy.com\include\field\TagField.class.php
[65] => C:\wwwroot\www.citycy.com\include\field\DatetimeField.class.php
[66] => C:\wwwroot\www.citycy.com\include\library\ThinkPHP\Lib\Think\Util\Template\TemplateSmarty.class.php
[67] => C:\wwwroot\www.citycy.com\include\Smarty\Smarty.class.php
[68] => C:\wwwroot\www.citycy.com\data\front\runtime\templates_c\%%F8^F84^F844ADE2%%article_view.html.php
[69] => C:\wwwroot\www.citycy.com\data\front\runtime\templates_c\%%71^714^714F4B17%%header.html.php
[70] => C:\wwwroot\www.citycy.com\include\Smarty\internals\core.load_plugins.php
[71] => C:\wwwroot\www.citycy.com\include\Smarty\internals\core.assemble_plugin_filepath.php
[72] => C:\wwwroot\www.citycy.com\include\tag\function.ffad.php
[73] => C:\wwwroot\www.citycy.com\data\ads\ad_1.php
[74] => C:\wwwroot\www.citycy.com\include\Ad.class.php
[75] => C:\wwwroot\www.citycy.com\data\front\runtime\templates_c\%%80^806^80621A61%%footer.html.php