您的位置:首页 > Web前端 > HTML5

【HTML5】HTML5 高级程序设计 学习笔记1 HTML5新特性简介

2015-09-21 18:47 731 查看
New DOCTYPE and Character Set

HTML5内容类型

Content TypeDescription
EmbeddedContent that imports other resources into the document, for example audio, video,canvas, and iframe
FlowElements used in the body of documents and applications, for example form, h1, and small
Heading Section headers,for example h1, h2, and hgroup
Interactive Content that users interact with,for example audio or video controls, button, and textarea
Metadata Elements—commonly found in the head section— that set up the presentation or
behavior of the rest of the document,for example script, style, and title
Phrasing Text and text markup elements,for example mark, kbd, sub, and sup
Sectioning Elements that define sections in the document,for example article, aside, and title


Semantic Markup 语义化标记

Sectioning ElementDescription
headerHeader content (for a page or a section of the page)
footerFooter content (for a page or a section of the page)
sectionA section in a web page
articleIndependent article content
asideRelated content or pull quotes
navNavigational aids


Simplifying Selection Using the Selectors API

以前:

FunctionDescription
getElementById()Returns the element with the specified id attribute value getElementById(“foo”);
getElementsByName()Returns all elements whose name attribute has the specified value
getElementsByTagName()Return all elements whose tag name matches the specified value
getElementsByTagName(“input”);
现在:

<script type="text/javascript">
document.getElementById("findHover").onclick = function() {
// find the table cell currently hovered in the page
var hovered = document.querySelector("td:hover");
if (hovered)
document.getElementById("hoverResult").innerHTML = hovered.innerHTML;
}
</script>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  html5 学习笔记