Академический Документы
Профессиональный Документы
Культура Документы
New in HTML5
The DOCTYPE declaration for HTML5 is very simple:
<!DOCTYPE html>
The character encoding (charset) declaration is also
very simple:
<meta charset="UTF-8">
HTML5 API's
The most interesting new API's are:
HTML Geolocation
HTML Drag and Drop
HTML Local Storage
HTML Application Cache
HTML Web Workers
HTML SSE
HTML 5 Example
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
</head>
<body>
Content of the document......
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Creating an HTML Element</title>
<script>document.createElement("myHero")</script>
<style>
myHero {
display: block;
background-color: #ddd;
padding: 50px;
font-size: 30px;
}
</style>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
<myHero>My First Hero</myHero>
</body>
</html> Demo
HTML 5 Skeleton
HTML Media
HTML5 Video
The HTML5 <video> element specifies a standard way
to embed a video in a web page.
controls attribute adds video controls, like play, pause,
and volume.
<video width="320" height="240" autoplay>
<source src="clipcanvas_14348_offline.mp4"
type="video/mp4">
Your browser does not support the video tag.
</video>
HTML Graphics
Draw a Line
To draw a straight line on a canvas, you use these
methods:
moveTo(x,y) defines the starting point of the line
lineTo(x,y) defines the ending point of the line
Demo
Draw a Circle
To draw a circle on a canvas, you use the following
methods:
beginPath();
arc(x,y,r,start,stop)
DEMO
SVG
SVG stands for Scalable Vector Graphics
SVG is used to define vector-based graphics for the Web
SVG defines the graphics in XML format
SVG graphics do NOT lose any quality if they are
zoomed or resized
Every element and every attribute in SVG files can be
animated
SVG is a W3C recommendation
SVG integrates with other W3C standards such as the
DOM and XSL
SVG Shapes
SVG has some predefined shape elements that can be
used by developers:
Rectangle <rect>
Circle <circle>
Ellipse <ellipse>
Line <line>
Polyline <polyline>
Polygon <polygon>
Path <path>
SVG <line>
The <line> element is used to create a line
<svg height="210" width="500">
<line x1="0" y1="0" x2="200" y2="200"
style="stroke:rgb(255,0,0);stroke-width:2" />
</svg>
M = moveto
L = lineto
H = horizontal lineto
V = vertical lineto
C = curveto
S = smooth curveto
Q = quadratic Bzier curve
T = smooth quadratic Bzier curveto
A = elliptical Arc
Z = closepath
All of the commands above can also be expressed with lower letters.
Capital letters means absolutely positioned, lower cases means
relatively positioned.
stroke
stroke-width
stroke-linecap
stroke-dasharray