What is HTML?
HTML (Hyper Text Mark-up Language). Hypertext Markup Language. HTML text is descriptive text composed of HTML commands. HTML commands can describe text, graphics, animations, sounds, tables, links, etc. The structure of HTML includes two parts: Head and Body. The head describes the information required by the browser, and the body contains the specific content to be explained. (HTML Video Tutorial)
The so-called effect that HTML5 can achieve is not an isolated upgraded version of HTML, but the combined performance of HTML+CSS3+JS. HTML is just a markup language, but it has been more semantically optimized, added some tags that are considered more scientific, and removed some tags, but tags are tags, and behaviors are behaviors. There is no CSS3, no JS, and HTML is not It's always just HTML. (html5 video tutorial)
Simply put, HTML5 is more semantic and standardized than the tags of previous HTML versions, and some new tags have been added. Please look at the picture below:
#This is the HTML form of the previous web page. The new HTML looks like this:
#What exactly does html5 have?
More semantic tags (developers can be more elegant and browsers can understand better)Search engine search, why does it search for the title and not the "Introduction" ? This is because of the difference in structure. However, everyone's class naming habits of the structure will be different, and it cannot be standardized, so it is better to create new tags. In some lower version browsers, the h5 tag is incompatible and will be considered p, which will not affect our functions. You can also add a new line of code document.createElement("header") in the script, but as many tags are used, you need to write as many lines of document.createElement(""), so there is a third-party plug-in html5shiv.jsUsage:
<!--[if lt IE 9]><script type="text/javascript" src="http://www.ijquery.cn/js/html5shiv.js"></script><![endif]-->Note: The Html5.js file called in the page must be added within the head element of the page, because the IE browser must know this before the element is parsed. element, so this js file cannot be called at the bottom of the page.
Application Tag
DataListprogressAttributes
Link Relationship Describe What is the relationship between the place linked to and the current document?<a href="01-sementic-tags.html" rel="pre"></a><a href="02-application-tags.html" rel="next"></a>rel also appears in other places,
<link rel="stylesheet" href="css.css">link itself will not request the file, but rel= "stylesheet" will only request the fileIt is not popular in China at the moment
Structure data tag
<p itemscope itemtype="www.baidu.com"> <p itemprop="主人">主人</p> <p itemprop="小狗">小狗一</p> <p itemprop="小狗">小狗二</p> </p>can facilitate search engines to focus on crawlingVery advanced, but only google supports it
ARIA
Accessible Rich Internet Application<label for="myinput">请输入您的名字</label> <input type="text" id="myinput">Why does it have to be labeled for above? is for the understanding of search engines
Custom attributes
That is, attributes such as data-*, they have no functionality, they are just for Save strongly related data of dom nodes.<ul id="list"></ul> <p id="info"></p> <script> var data={ 01:{ name:"张三", age:18 }, 02:{ name:"李四", age:19 }, 03:{ name:"王五", age:20 } }; for (var X in data) { var item=data[X]; var oli=document.createElement("li"); var olist=document.getElementById("list"); oli.appendChild(document.createTextNode(item.name)); olist.appendChild(oli); oli.setAttribute("data-name",item.name); oli.setAttribute("data-age",item.age ); oli.addEventListener("click", function () { var name=this.getAttribute("data-name"); var age=this.getAttribute("data-age"); alert(age+name) }) } </script>
上面的代码用 setattribue 方法来定义了自定义属性,然后用getattribute又获取到了自定义属性。js也针对自定义属性出了新的api,也就是 dataset['string'] ,使用这个api可以代替 getAttribute 的方法:
oli.addEventListener("click",function(){ console.log(this.dataset["name"]); })
智能表单
新的表单类型
<input type="date"> <input type="color"> <input type="range">
但是尽量不要在pc端使用,用户体验较差,不能自定义样式。主要适配在移动端。
虚拟键盘适配
<input type="text" name="txt_text" id="txt_text"> <input type="number" name="txt_number" id="txt_number"> <input type="email" name="txt_email" id="txt_email"> <input type="tel" name="txt_tel" id="txt_tel"> <input type="url" name="txt_url" id="txt_url">
上面的代码在pc端上没有用处,主要是用在移动端可以根据不同的input的 type 来唤出不同的键盘。
虽然 input type="email" 看似可以验证表单,但是真是太弱了,只是验证有没有 @ ,真的要验证的话,还是要自己写正则表达式
页面多媒体
音频
<audio src="A Moment of Reflection.mp3" controls="controls"></audio>
但是默认的播放器太丑了,我们一般是自己写一个button,然后为这个button添加一个事件:
<script> var btn=document.getElementById("btn"); var btn1=document.getElementById("btn1"); var audio=document.getElementsByTagName("audio")[0]; btn.addEventListener("click", function () { audio.play(); }) btn1.addEventListener("click",function (argument) { audio.pause(); }) </script>
视频
<video src="A Moment of Reflection.mp4" controls="controls"></video>
但是我们一般不是这样用的,因为视频有版权,有些浏览器只能支持一两个,我们一般是source:
<video controls="controls"><source src="下午03-网页多媒体.web.mp4"><source src="下午03-网页多媒体.web.ogg"><p>您的浏览器不支持</p></video>
还有一个插件,是可以帮我们做兼容的,是html5media.info/的组件,ie7以上都可以兼容。
以下是多媒体的属性;
[image_1b2cut34s130mfufars1a6m6va9.png-66.1kB][1]
字幕
兼容性不是很好,现在还没有人用
canvas
2d
3d
svg
优势:体积小,质量高,效果好,可控程度高。
相关推荐:

html5的div元素默认一行不可以放两个。div是一个块级元素,一个元素会独占一行,两个div默认无法在同一行显示;但可以通过给div元素添加“display:inline;”样式,将其转为行内元素,就可以实现多个div在同一行显示了。

html5中列表和表格的区别:1、表格主要是用于显示数据的,而列表主要是用于给数据进行布局;2、表格是使用table标签配合tr、td、th等标签进行定义的,列表是利用li标签配合ol、ul等标签进行定义的。

固定方法:1、使用header标签定义文档头部内容,并添加“position:fixed;top:0;”样式让其固定不动;2、使用footer标签定义尾部内容,并添加“position: fixed;bottom: 0;”样式让其固定不动。

HTML5中画布标签是“<canvas>”。canvas标签用于图形的绘制,它只是一个矩形的图形容器,绘制图形必须通过脚本(通常是JavaScript)来完成;开发者可利用多种js方法来在canvas中绘制路径、盒、圆、字符以及添加图像等。

html5中不支持的标签有:1、acronym,用于定义首字母缩写,可用abbr替代;2、basefont,可利用css样式替代;3、applet,可用object替代;4、dir,定义目录列表,可用ul替代;5、big,定义大号文本等等。

html5废弃了dir列表标签。dir标签被用来定义目录列表,一般和li标签配合使用,在dir标签对中通过li标签来设置列表项,语法“<dir><li>列表项值</li>...</dir>”。HTML5已经不支持dir,可使用ul标签取代。

html5是指超文本标记语言(HTML)的第五次重大修改,即第5代HTML。HTML5是Web中核心语言HTML的规范,用户使用任何手段进行网页浏览时看到的内容原本都是HTML格式的,在浏览器中通过一些技术处理将其转换成为了可识别的信息。HTML5由不同的技术构成,其在互联网中得到了非常广泛的应用,提供更多增强网络应用的标准机。

3种取消方法:1、给td元素添加“border:none”无边框样式即可,语法“td{border:none}”。2、给td元素添加“border:0”样式,语法“td{border:0;}”,将td边框的宽度设置为0即可。3、给td元素添加“border:transparent”样式,语法“td{border:transparent;}”,将td边框的颜色设置为透明即可。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

Notepad++7.3.1
Easy-to-use and free code editor

Atom editor mac version download
The most popular open source editor

WebStorm Mac version
Useful JavaScript development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
