HTML5系列之1:基础
来源:互联网 发布:大商创源码 编辑:程序博客网 时间:2024/05/16 17:29
一、新增的语义化标签:
- 简洁的 DOCTYPE HTML5 只需一个简洁的文档类型:<!DOCTYPE html>。它有意不使用版本,因此文档将会适用所有版本的HTML。
- 简单易记的语言标签 你并不需要在 <html> 中使用 xmlns 或 xml:lang 标记。 <html lang=”en”> 将对 HTML5 有效。
- 简单易记的编码类型 你现在可以在 meta 标签中使用 “charset”:<meta charset=”utf-8″ />
- 不需要闭合标签 在 HTML5 中,空标签(如:br、img 和 input )并不需要闭合标签。
- 新增标签 新增的语义化标签
header, hgroup, nav, section, article, details, figure, figcaption, aside, time, mark, audio, video, source, track, bdi, canvas, command, datalist, summary, embed, keygen, meter, output, progress, rp, rt, ruby, - 废弃的标签 下面这些标签并不被 HTML5 支持: <acronym>、<applet>、<basefont>、<big>、<center>、<dir>、<font>、<frame>、<frameset>、<noframes>、<s>[删除线]、<strike>[删除线]、<tt>[定义打字机文本]、<u>[下划线文本]; 和 <xmp>[和pre类似];
- 新增属性 在 HTML5 中,增加了很多form表单属性,当然还有其他属性。
required, from, pattern, placeholder, email, range[min, max, step], url, date, time, datetime, datetime-local, month, week, tel, number, search, --, contentcontenteditableable, contextmenu, data-yourvalue, draggable, item, itemprop, spellcheck, subject
例如:
<!doctype html> <html lang="en"><head><span style="white-space:pre"></span><meta charset="utf-8" /><span style="white-space:pre"></span><title>HTML5 Document</title></head><body><span style="white-space:pre"></span><header> </header><span style="white-space:pre"></span><section> </section><span style="white-space:pre"></span><footer> </footer></body></html>
二、Selected API
1. 传统dom操作:document.getElementById 、getElementsByName、getElementsByTagName
2. Selected API :document.querySelector() - 返回匹配的第一个元素、querySelectorAll() - 返回所有被匹配的元素
例如:document.querySelector("input.error");//选取类名为error的input控件
document.querySelector(".highClass",".lowClass"); //选取类名为highClass或lowClass的第一个元素
document.querySelectorAll("#results td"); //取ID为results的元素下的所有单元格
document.querySelector("td:hover"); //返回当前用户鼠标所停留的单位格元素
0 0
- HTML5系列之1:基础
- html5之canvas基础1
- HTML5 之基础 (1)
- HTML5学习系列之Audio(1)
- Html5系列之Canvas
- HTML5 -------之基础
- HTML5之canvas基础
- Html5基础之标签
- Html5基础之样式
- Web基础之HTML5
- Html5 系列之:Canvas绘图
- Html5 系列之:地理位置Geolocation
- 一,细说 HTML5 之 HTML5 基础讲解
- HTML5系列教程1
- 零基础学习HTML5系列课程
- HTML5系列(3)data-*基础
- HTML5之Cancas基础篇
- Html5学习之路 基础
- Excel VBA Interior.ColorIndex 色彩列表
- samba安装和配置
- groovy多表关联查询
- Wlan常用命令
- cin的几个基本用法
- HTML5系列之1:基础
- asp.net mvc 中验证码
- usaco3.3.2 骑马修栅栏
- MFC检测串口插拔
- Eclipse快捷键 10个最有用的快捷键
- IE里url乱码解决办法
- http协议状态表
- 如何用摄像头来测距(opencv)(转)
- Python中的下划线