`

html5

阅读更多

HTML5 is the latest and most enhanced version of HTML. Technically, HTML is not a
programming language, but rather a markup language. This tutorial gives very good
understanding on HTML5.
HTML5 Overview
HTML5 is the next major revision of the HTML standard superseding HTML 4.01, XHTML 1.0, and
XHTML 1.1. HTML5 is a standard for structuring and presenting content on the World Wide Web.
HTML5 is a cooperation between the World Wide Web Consortium (W3C) and the Web Hypertext
Application Technology Working Group (WHATWG).
The new standard incorporates features like video playback and drag-and-drop that have been
previously dependent on third-party browser plug-ins such as Adobe Flash, Microsoft Silverlight,
and Google Gears.
Browser Support:
The latest versions of Apple Safari, Google Chrome, Mozilla Firefox, and Opera all support many
HTML5 features and Internet Explorer 9.0 will also have support for some HTML5 functionality.
The mobile web browsers that come pre-installed on iPhones, iPads, and Android phones all
have excellent support for HTML5.
New Features:
HTML5 introduces a number of new elements and attributes that helps in building a modern
websites. Following are great features introduced in HTML5.
 
New Semantic Elements: These are like <header>, <footer>, and <section>.
Forms 2.0: Improvements to HTML web forms where new attributes have been
introduced for <input> tag.
Persistent Local Storage: To achieve without resorting to third-party plugins.
WebSocket : A a next-generation bidirectional communication technology for web
applications.
Server-Sent Events: HTML5 introduces events which flow from web server to the web
browsers and they are called Server-Sent Events (SSE).
Canvas: This supports a two-dimensional drawing surface that you can program with
JavaScript.
Audio & Video: You can embed audio or video on your web pages without resorting to
third-party plugins.
Geolocation: Now visitors can choose to share their physical location with your web
application.
Microdata: This lets you create your own vocabularies beyond HTML5 and extend your
web pages with custom semantics.
Drag and drop: Drag and drop the items from one location to another location on a
the same webpage.
Backward Compatibility
HTML5 is designed, as much as possible, to be backward compatible with existing web browsers.
New features build on existing features and allow you to provide fallback content for older
browsers.
It is suggested to detect support for individual HTML5 features using a few lines of JavaScript.
If you are not familiar with any previous version of HTML, I would recommend to go through our
HTML Tutorial before you explore further concepts of HTM5.
HTML5 Syntax
The HTML 5 language has a "custom" HTML syntax that is compatible with HTML 4 and XHTML1
documents published on the Web, but is not compatible with the more esoteric SGML features of
HTML 4.
HTML 5 does not have the same syntax rules as XHTML where we needed lower case tag
names, quoting our attributes,an attribute had to have a value and to close all empty elements.
But HTML5 is coming with lots of flexibility and would support the followings:
 
Uppercase tag names.
Quotes are optional for attributes.
Attribute values are optional.
Closing empty elements are optional.
The DOCTYPE:
DOCTYPEs in older versions of HTML were longer because the HTML language was SGML based

and therefore required a reference to a DTD.
HTML 5 authors would use simple syntax to specify DOCTYPE as follows:
<!DOCTYPE html>
All the above syntax is case-insensitive.
Character Encoding:
HTML 5 authors can use simple syntax to specify Character Encoding as follows:
<meta charset="UTF-8">
All the above syntax is case-insensitive.
The <script> tag:
It's common practice to add a type attribute with a value of "text/javascript" to script elements
as follows:
<script type="text/javascript" src="scriptfile.js"></script>
HTML 5 removes extra information required and you can use simply following syntax:
<script src="scriptfile.js"></script>
The <link> tag:
So far you were writing <link> as follows:
<link rel="stylesheet" type="text/css" href="stylefile.css">
HTML 5 removes extra information required and you can use simply following syntax:
<link rel="stylesheet" href="stylefile.css">
HTML5 Elements:
HTML5 elements are marked up using start tags and end tags. Tags are delimited using angle
brackets with the tag name in between.
The difference between start tags and end tags is that the latter includes a slash before the tag
name.
Following is the example of an HTML5 element:
<p>...</p>
HTML5 tag names are case insensitive and may be written in all uppercase or mixed case,
although the most common convention is to stick with lowercase.
Most of the elements contain some content like <p>...</p> contains a paragraph. Some
elements, however, are forbidden from containing any content at all and these are known as
void elements. For example, br, hr, link and meta etc.
HTML5 Attributes:
Elements may contain attributes that are used to set various properties of an element.
Some attributes are defined globally and can be used on any element, while others are defined
for specific elements only. All attributes have a name and a value and look like as shown below
in the example.
Following is the example of an HTML5 attributes which illustrates how to mark up a div element
with an attribute named class using a value of "example":
<div class="example">...</div>
Attributes may only be specified within start tags and must never be used in end tags.
HTML5 attributes are case insensitive and may be written in all uppercase or mixed case,
although the most common convention is to stick with lowercase.
HTML5 Document:
The following tags have been introduced for better structure:








section: This tag represents a generic document or application section. It can be used
together with h1-h6 to indicate the document structure.
article: This tag represents an independent piece of content of a document, such as a
blog entry or newspaper article.
aside: This tag represents a piece of content that is only slightly related to the rest of
the page.
header: This tag represents the header of a section.
footer: This tag represents a footer for a section and can contain information about the
author, copyright information, et cetera.
nav: This tag represents a section of the document intended for navigation.
dialog: This tag can be used to mark up a conversation.
figure: This tag can be used to associate a caption together with some embedded
content, such as a graphic or video.
The markup for an HTM 5 document would look like the following:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>...</title>
</head>
<body>
<header>...</header>
<nav>...</nav>
<article>
<section>
...
</section>
</article>
<aside>...</aside>
<footer>...</footer>
</body>
HTML5 Attributes
As explained in previous chapter, elements may contain attributes that are used to set various
properties of an element.
Some attributes are defined globally and can be used on any element, while others are defined
for specific elements only. All attributes have a name and a value and look like as shown below
in the example.
Following is the example of an HTML5 attributes which illustrates how to mark up a div element
with an attribute named class using a value of "example":
<div class="example">...</div>
Attributes may only be specified within start tags and must never be used in end tags.
HTML5 attributes are case insensitive and may be written in all uppercase or mixed case,
although the most common convention is to stick with lowercase.
Standard Attributes:
The attributes listed below are supported by almost all the HTML 5 tags.
Attribute Options Function
accesskey User Defined Specifies a keyboard shortcut to access an element.
align right, left, center Horizontally aligns tags
background URL Places an background image behind an element
bgcolor numeric, hexidecimal, Places a background color behind an element
        RGB values
class User Defined Classifies an element for use with Cascading Style
                  Sheets.
contenteditable true, false Specifies if the user can edit the element's content or
not.

分享到:
评论

相关推荐

    《HTML5开发精要与实例详解》配套源码

    此为《HTML5开发精要与实例详解》的全部配套源码 本书由资深Web开发专家亲自执笔,内容的权威性上应该是毋庸置疑的。 本书在内容结构上将继承《HTML 5与CSS 3权威指南》一书的优点,几乎每个知识点都将配一个精心...

    HTML 5 Canvas基础教程 源码+PDF

    《HTML 5 Canvas基础教程》从HTML5和JavaScript(以及jQuery)的基础知识讲起,全面介绍了HTML5Canvas的各种特性,包括渲染上下文、坐标系统、绘制图形、保存和恢复画布状态,以及变形、合成、处理图像和视频等,让...

    简约左侧菜单HTML5全屏网站 html5响应式网站源码

    HTML5响应式网站(支持在线订单、手机版)以asp+access进行开发,前台采用html5响应式技术,使网站即可在电脑端进行访问,也可在手机端进行访问。 程序特色: 一:使搜索引擎更加容易抓取和索引 二:提供更多的功能,...

    从零学HTML5 精品教程(23G百度网盘)

    ===1:HTML5 优质视频教程集锦(赠送HTML 基础=== 01【赠 送】带你一周 HOLD 住 HTML + CSS 02【赠 送】最棒的 HTML DIV CSS 学习教程(含讲义源码) 03【高 清】HTML5 视频教程(含讲义源码) 04【苏 鹏】HTML5 ...

    html5shiv.js

    越来越多的站点开始使用 HTML5 标签。但是目前的情况是还有很多人在使用IE6,IE7,IE8。为了让所有网站浏览者都能正常的访问网站,解决方案就有下面两个: 1.为网站创建多套模板,通过程序对User-Agent的判断给不同...

    [HTML5] HTML5 基础教程 英文版

    HTML5 is required knowledge for every professional web designer and developer This book will quickly get you up to speed with the fundamentals of HTML5 and give you the confidence to start ...

    [HTML5] HTML5 实战 英文版

    HTML5 in Action provides a complete introduction to web development using HTML5 You&quot;ll explore every aspect of the HTML5 specification through real world examples and code samples It&quot;s much ...

    HTML5+CSS3+jquery应用之美

    HTML5、CSS3与jQuery俨然成为了标准Web制作技术的黄金组合。《HTML5+CSS3+jQuery应用之美》由韩国专业视觉设计师倾力奉献其多年商业网站设计与制作的从业经验,通过八大商业案例,以HTML5搭建结构、CSS3设置样式、...

    Html 5 App 界面模板(HTML5模板)

    Html 5 App 界面模板Html 5 App 界面模板Html 5 App 界面模板

    html5调用相机

    html5调用相机

    HTML 5 参考手册

    HTML 5 参考手册 W3C 在 1 月 22 日发布了最新的 HTML 5 工作草案。HTML 5 工作组包括 AOL, Apple, Google, IBM, Microsoft, Mozilla, Nokia, Opera 以及数百个其他的开发商。HTML 5 中的一些新特性:嵌入音频、...

    HTML5视频播放器美化

    HTML5视频播放器美化HTML5视频播放器美化HTML5视频播放器美化

    arm语音html5直接播放实现仿微信播放动画

    1.html5标签播放amr语音 &lt;audio src="http://xxxxxx/media/1.amr" id="media" width="1" height="1" preload=""&gt;&lt;/audio&gt; 2.修改封装weixinAudio.js 实现仿微信语音播放动画 3.项目集成ffmpeg for linux 后台直接...

    HTML5设计原理

    今天我想跟大家谈一谈HTML5的设计。主要分两个方面:一方面,当然了,就是HTML5。我可以站在这儿只讲HTML5,但我并不打算这样做,因为如果你想了解HTML5的话,你可以Google,可以看书,甚至可以看规范。 实际上,...

    使用HTML5技术制作在线PDF阅读器(附源码)

    这个技术原型主要用于在HTML5 平台上展示 PDF 文档,无需任何本地技术支持,但浏览器必须技持HTML5。 建议开发童鞋使用统一开发环境UDE来进行查看、调试、开发~~~统一开发环境是一款HTML5跨平台一站式应用开发、调试...

    一个简单HTML5期末考核大作业,学生个人html静态网页制作代码

    HTML5期末考核大作业源码 包含 个人、 美食、 公司、 学校、 旅游、 电商、 宠物、 电器、 茶叶、 家居、 酒店、 舞 蹈、 动漫、 服装、 体育、 化妆品、 物流、 环保、 书籍、 婚纱、游戏、 节日、 戒烟、 电影、 ...

    HTML5炫酷科技感十足数据可视化

    HTML5炫酷科技感十足数据可视化HTML5炫酷科技感十足数据可视化HTML5炫酷科技感十足数据可视化HTML5炫酷科技感十足数据可视化HTML5炫酷科技感十足数据可视化HTML5炫酷科技感十足数据可视化HTML5炫酷科技感十足数据...

    HTML5 in Action

    HTML5 in Action provides a complete introduction to web development using HTML5. You’ll explore every aspect of the HTML5 specification through real-world examples and code samples. It’s much more ...

    jQuery+html5实现的3D焦点轮播幻灯片(html5zoo.js html5zoo-slides).zip

    jQuery+html5实现的3D焦点轮播幻灯片(html5zoo.js html5zoo-slides) 两个演示可以参考

Global site tag (gtag.js) - Google Analytics