frame, frameset noframes.
.
acronym, , ́ : [2]. acronym abbr. , , : (: , ), : , .
, , font, big, center strike, HTML5. : CSS-: , font-size text-align. , : bgcolor, cellspacing, cellpadding valign, . CSS.
, , . , .
, !
big , small . , , . , : . : , , .
, , , .
b : . , , . , , strong.
i . , . , . , , em.
. , , , HTML5 . , , , . , , : , , . .
|
|
HTML5 cite. , , . (, ), . HTML5 cite. , .
: <cite> ; [3], , , cite , .
. , HTML5 , , .
, , <cite> , , -, cite , .
a
, HTML5 .
a, , HTML. . .
a (inline) . , a:
<h2><a href="/about"> </a></h2>
<p><a href="/about">, .</a></p>
HTML5 a:
<a href="/about">
<h2> </h2>
<p>, .</p>
</a>
a a.
, a , , . , HTML5 .
: , ? : , .
! API JavaScript
CSS, CSS. , HTML. API JavaScript, document.write, innerHTML window.history? JavaScript API.
API JavaScript , , , . HTML5 API , .
|
|
, JavaScript , , HTML5 - (Web Apps 1.0). JavaScript -.
HTML5 API -. , , (UndoManager), . - . .
, , , . Internet Explorer API , HTML5. , API Microsoft . , , .
API HTML5 . . , . API , .
HTML5 , , -, . .
. HTML img, . JavaScript . , Ajax- , .
- , HTML, CSS JavaScript.
- . , , HTML CSS. , , , , Flash Silverlight.
( ) : . -, . . , .
Flash , , , . , - .
HTML5 . , (, Flash Silverlight). , - HTML5 .
Canvas
Mosaic - , . . . JavaScript. . , .
canvas .
. , , :
<canvas id="my-first-canvas" width="360" height="240">
</canvas>
- , , Canvas (. 3.01):
|
|
<canvas id="my-first-canvas" width="360" height="240">
<p> canvas? ,-:</p>
<img src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/puppy.jpg" alt=" ">
</canvas>
canvas? :
. 3.01. , canvas,
JavaScript. , Canvas . API. :
var canvas = document.getElementById(my-first-canvas);
var context = canvas.getContext(2d);
canvas, API, HTML5 : http://bkaprt.com/html5/.[4]
2D API , (, Adobe Illustrator), , , , , , . , , JavaScript.
:
, :
context.strokeStyle = #990000;
, , . , , :
strokeRect (left, top, width, height)
100×50 , 20 30 canvas, (. 3.02):
context.strokeRect(20,30,100,50);
. 2D API : fillStyle, fillRect, lineWidth, shadowColor .
. 3.02. , canvas
, , Illustrator, canvas. , , JavaScript. Canvas .
Canvas. ! ?
JavaScript Canvas , , ?
Canvas , , . , , , , Flash.
Canvas Mozilla Labs. Bespin (https://bespin.mozilla.com) , (. 3.03).
. . , Canvas .
. 3.03. Bespin, Canvas
. Bespin canvas ; , .
(Document Object Model, DOM). DOM , , . canvas DOM. , canvas, .
|
|
, , , . DOM .
Canvas HTML5. , , (http://bkaprt.com/html5/2)[5].
Canvas , , - . , , Canvas HTML5.
Canvas
, , Canvas -. .
JavaScript, , . , JavaScript, , , JavaScript.
, JavaScript, Canvas. Canvas , , .
, . , . , , Google Chart API. , , , Canvas , . , , canvas, table.
Filament Group jQuery- (. 3.04; http://bkaprt.com/html5/3)[6].
. 3.04. Canvas ,
. Canvas API . SVG (Scalable Vector Graphics, ) XML-, , Canvas.
XML , SVG , .
SVG , Canvas. Canvas , . Safari, Firefox, Opera Chrome Canvas. JavaScript-, Canvas Internet Explorer (http://bkaprt.com/html5/4)[7].
WHATWG , , Canvas HTML5, SVG. , HTML5 , . canvas HTML5; Apple Safari. , Apple, , .
- , -. , XX Microsoft XMLHttpRequest Internet Explorer 5.
, W3C .
- Canvas . , .
Audio
, , - . , , . . : QuickTime, Windows Media Player, Real Audio, , - - .
MP3. , . Flash.
|
|
, , HTML5.
HTML5- :
<audio src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman.mp3">
</audio>
, . , audio.
, , . , , , . autoplay .
<audio src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman.mp3" autoplay >
</audio>
- autoplay, : .
, autoplay . , , [8].
: , ; , ; (true), (false).
. , , true false. : . , . autoplay="false" autoplay="no thanks" , autoplay.
XHTML, autoplay="autoplay". .
, , . , loop, :
<audio src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman.mp3" autoplay loop >
</audio>
loop autoplay .
-
audio , . , controls:
<audio src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman.mp3" controls >
</audio>
controls , , (. 3.05).
. 3.05. controls, ,
, . JavaScript Audio API, (play pause) (volume .). , button , (. 3.06):
<audio id="player" src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman.mp3">
</audio>
<div>
<buttononclick="document.getElementById(player). play()">
</button>
<buttononclick="document.getElementById(player). pause()">
</button>
<buttononclick="document.getElementById(player). volume+= 0.1">
</button>
<buttononclick="document.getElementById(player). volume-= 0.1">
</button>
</div>
. 3.06. (, , , ), button
- HTML5 audio. autobuffer autoplay. , , - , .
, , , Safari . , autobuffer . , - , autobuffer , Safari, : autobuffer="false" , autobuffer="true" (http://bkaprt.com/html5/5)[9].
autobuffer preload. . : none, auto metadata. preload="none", , :
<audio src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman.mp3" controls preload="none" >
</audio>
audio, , preload="auto", audio , - - .
́, , á
audio . - , ? .
audio . .
MP3 , . - , , MP3, . Apple Adobe , - . Safari MP3-, a Firefox .
. Vorbis .ogg . Firefox Ogg Vorbis, Safari .
, audio, [10] . src <audio>, source:
<audio controls>
<source src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman. ogg ">
<source src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman. mp3 ">
</audio>
, Ogg Vorbis, source. , MP3, Ogg Vorbis, source source.
MIME- :
<audio controls>
<source src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman.ogg" type="audio/ogg" >
<source src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman.mp3" type="audio/mpeg" >
</audio>
source ( ) , XHTML, <source />.
source . , audio . , ?
Internet Explorer , , Flash. audio . , <audio> source , audio:
<audio controls>
<source src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman.ogg type="audio/ogg">
<source src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman.mp3 type="audio/mpeg">
<object type="application/x-shockwave-flash"data="player.swf?soundFile=witchitalineman.mp3">
<param name="movie"value="player.swf?soundFile=witchitalineman.mp3">
</object>
</audio>
object , audio.
. object, , . , , , :
<audio controls>
<source src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman.ogg" type="audio/ogg">
<source src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman.mp3" type="audio/mpeg">
<object type="application/x-shockwave-flash"data="player.swf?soundFile=witchitalineman.mp3">
<param name="movie"value="player.swf?soundFile=witchitalineman.mp3">
<a href="witchitalineman.mp3"> </a>
</object>
</audio>
.
1. audio Ogg Vorbis.
2. audio MP3.
3. audio, Flash-.
4. audio, Flash-.
audio . , .
, . :
<audio controls>
<source src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman.ogg" type="audio/ogg">
<source src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman.mp3" type="audio/mpeg">
<p>I am a lineman for the county</p>
</audio>
, audio. . , ?
<audio controls>
<source src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman.ogg" type="audio/ogg">
<source src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/witchitalineman.mp3" type="audio/mpeg">
</audio>
<p>I am a lineman for the county</p>
Video
, - . - , . Flash-. HTML5 .
video , audio. autoplay, loop preload. src video, source, <video>. controls .
, , , , :
<video src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/movie.mp4" controls width="360" height="240" >
</video>
, , poster (. 3.07):
<video src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/movie.mp4" controls width="360"height="240" poster="placeholder.jpg" >
</video>
. 3.07. poster -
, . MP4 Theora Video ( ). , , HTML5 video :
<video controls width="360" height="240"poster="placeholder.jpg">
<source src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/movie.ogv" type="video/ogg">
<source src="/storage/public/books/c3/f0/c3f0bf21-f7c0-4c8e-a8c5-58aa37eb5140/movie.mp4" type="video/mp4">
<object type="application/x-shockwave-flash"width="360" height="240"data="player.swf?file=movie.mp4">
<param name="movie"value="player.swf?file=movie.mp4">
<a href="movie.mp4"> </a>
</object>
</video>
HTML5 , . , .
- , HTML img. , , Google, . , YouTube, : http://youtube.com/html5.
, , . - HTML JavaScript CSS. video JavaScript, (. 3.08).
. 3.08. video
- .
HTML5, , . . 4 , HTML5 .
- 2.0
- JavaScript, : . CSS :hover, - JavaScript , .
. - , , , . CSS3 , JavaScript.
, CSS . HTML5. , HTML5 .
WHATWG, - 2.0 W3C. HTML5.
Placeholder
, DOM:
1. , -.
2. , -.
3. - , -.
- , . CSS, JavaScript .
HTML5 placeholder (. 4.01):
<label for="hobbies"> </label>
<input id="hobbies" name="hobbies" type="text" placeholder=" " >
. 4.01. input placeholder
placeholder , , , , - . , , .
. , .
JavaScript. , JavaScript , placeholder.
JavaScript- , , :
function elementSupportsAttribute(element,attribute) {
var test = document.createElement(element);
if (attribute in test) {
return true;
} else {
return false;
}
}
: ( ), , , , . true false.
, JavaScript- , placeholder:
if (!elementSupportsAttribute('input','placeholder')) {
// JavaScript.
}
Autofocus
! . , : Google: Twitter: ?
, JavaScript:
1. , .
HTML5 autofocus:
<label for="status"> ?</label>
<input id="status" name="status" type="text" autofocus >
. , , . , Twitter, , , , , .
, autofocus HTML5 , : . , . , , .
, , , , . , HTML5 . JavaScript JavaScript . , , , , , , , .
placeholder, , autofocus, , , JavaScript:
if (!elementSupportsAttribute('input','autofocus')){
document.getElementById('status'). focus();
}
autofocus input; , , textarea select, .
Required
JavaScript . HTML5 JavaScript . required:
<label for="pass"> </label>
<input id="pass" name="pass" type="password" required>
, . , , required , JavaScript. class="required", required.
Autocomplete
-. , , , . . , . , , , , , , , .
HTML5 - . autocomplete , : on off :
<form action="/selfdestruct" autocomplete="off" >
, autocomplete on, .
, , . , , - , :
<input type="text" name="onetimetoken" autocomplete="off" >
JavaScript , autocomplete, . HTML5 , JavaScript.
HTML5. HTML5 , , . , , .
Datalist
datalist input select. list (. 4.02):
<label for="homeworld"> </label>
<input type="text" name="homeworld" id="homeworld" list="planets" >
<datalist id="planets">
<option value="">
<option value="">
<option value="">
<option value="">
<option value="">
<option value="">
<option value="">
<option value="">
</datalist>
. 4.02. datalist
, . , , : , , 养 (. 4.03).
. 4.03. datalist: , ,
datalist , . datalist, .
HTML5 type input. , , .
input search type , text type:
<label for="query"></label>
<input id="query" name="query" type="search">
text search , , . Safari (. 4.04).
. 4.04. Safari Mac OS
HTML5 type : e-mail-, - :
<label for="email">Email-</label>
<input id="email" name="email" type="email" >
<label for="website"></label>
<input id="website" name="website" type="url" >
<label for="phone"></label>
<input id="phone" name="phone" type="tel" >
, , , .
Safari , , - type="text". , Mobile Safari, . type (. 4.05).
, Webkit, .
. 4.05. Mobile Safari type
JavaScript- , -. JavaScript. , JavaScript- , .
. JavaScript , - . HTML5 type="range" , :
<label for="amount"> ?</label>
<input id="amount" name="amount" type="range" >
Safari Opera , (. 4.06).
. 4.06. range Safari Opera
. min max:
<label for="rating"> </label>
<input id="rating" name="rating" type="range" min="1" max="5" >
Safari Opera ; . , , , , , JavaScript , type="range".
, , , . input. type , .
type, text, , , .
, , - :
function inputSupportsType(test) {
var input = document.createElement('input');
input.setAttribute('type',test);
if (input.type == 'text') {
return false;
} else {
return true;
}
}
, , JavaScript-widget , :
if (!inputSupportsType(range)) {
// JavaScript.
}
, , , JavaScript, , DOM. , , JavaScript, range Safari !
range . . . , . type="number":
<label for="amount"> ?</label>
<input id="amount" name="amount" type="number" min="5" max="20">
, , (. 4.07).
number text range. , text, , , range.
JavaScript- . , : . , .
, , -. .
HTML5 :
date , .
datetime , , , .
datetime-local , .
time , .
month , .
- YYYY-MM-DDThh: mm: ss.Z (Y , M , D , h , m , s , Z ). , , , , 11:11 11 1918 :
date: 1918-11-11
datetime: 1918-11-11T11:11:00+01
datetime-local: 1918-11-11T11:11:00
time: 11:11:00
month: 1918-11
year , week, 1 53 .
:
<label for="dtstart"> </label>
<input id="dtstart" name="dtstart" type="date" >
Opera , (. 4.08).
. 4.08. Opera
, , , . ISO JavaScript- , . , :
if (!inputSupportsType('date')) {
// .
}
JavaScript , . , , .
, HTML5, JavaScript-, color. : #000000 , #FFFFFF .
<label for="bgcolor"> </label>
<input id="bgcolor" name="bgcolor" type="color">
, , . , , , , .
JavaScript, , .
: , , . HTML5 , , , .
: pattern , , . : :
<label for="zip"> </label>
<input id="zip" name="zip" pattern="[\d]{5}(-[\d]{4})" >
pattern. , , .
HTML5 . , JavaScript, . , . JavaScript , .
; . , JavaScript- .
, , , : ?
. : . CSS.
. , - , JavaScript-, .
, : ?
, . , , , , , .
, , HTML5-. , .
, HTML5.
HTML . , , , .
, , , . HTML , , , .
, - , . , HTML , , .
, HTML , , .
, . XML, , event price, . , , event price. HTML , , , . HTML. , .
HTML , - class. . , , class, .
: