<section>
+ <article>
+ <header>
+ <footer>
+ <nav>
+ <aside>
<hgroup>
<audio>
+ <video>
+ <source>
<embed>
<canvas>
<details>
+ <summary>
<figure>
+ <figcaption>
<progress>
+ <meter>
<output>
<command>
<time>
<mark>
<ruby>
+ <rp>
+ <rt>
<wbr>
<menu>
<datalist>
<keygen>
<body> <div class='presentation'> <div class='slides'> <div class='slide'> <h1> Slide title </h1> <div class='contents'> Slide contents </div> </div> ... </div> </div> </div> div.presentation { background: black; } div.slides { ... } div.slide { position: absolute; }
<body> <presentation> <slides> <slide> <header> Slide title </header> <section> Slide contents </section> </slide> ... </slides> </presentation> </body> presentation { background: black; } slides { ... } slide { position: absolute; }
<body> <header> <hgroup> <h1>Page title</h1> <h2>Page subtitle</h2> </hgroup> </header> <nav> <ul> Navigation... </ul> </nav> <section> <article> <header> <h1>Title</h1> </header> <section> Content... </section> </article> <article> <header> <h1>Title</h1> </header> <section> Content... </section> </article> <article> <header> <h1>Title</h1> </header> <section> Content... </section> </article> </section> <aside> Top links... </aside> <footer> Copyright © 2009. </footer> </body>
<acronym>
<applet>
<basefont>
<big>
<center>
<dir>
<font>
<frame>
<frameset>
<noframes>
<strike>
<s>
<tt>
<u>
<xmp>
<input type='range' value='0' min='0' max='50' > <input type='number' min='0' max='100' step='5'> <input type='date' min='2010-08-14' max='2011-08-14'> <input type='time'> <input type='tel' pattern='^\(?\d{3}\)?[-\s]\d{3}[-\s]\d{4}.*?$'> <input type='email'> <progress>Loading…</progress> <progress value='75' max='100'>75% complete</progress>40 days <meter value='40' min='0' max='100'>40 days</meter>
<menu> <input type='color'> <input type='month'> <input type='week'> <input type='datetime'>
type='text'
type='email'
type='number'
type='tel'
<input autofocus>
<input type='text' placeholder='Search Google.com'>
<input type='text' required> <style> [required] { border-color: #88a; -webkit-box-shadow: 0 0 3px rgba(0, 0, 255, .5); } </style>
<input type='email'> <style> [:invalid] { border-color: #e88; -webkit-box-shadow: 0 0 5px rgba(255, 0, 0, .8); } </style>
<link rel='alternate' type='application/rss+xml' href='http://myblog.com/feed' /> <link rel='icon' href='/favicon.ico' /> <link rel='pingback' href='http://myblog.com/xmlrpc.php'> <link rel='prefetch' href='http://myblog.com/main.php'> ...
<a rel='nofollow' href='http://notmysite.com/sample'>wannabe</a> <a rel='archives' href='http://myblog.com/archives'>old posts</a> <a rel='external' href='http://notmysite.com'>tutorial</a> <a rel='license' href='http://www.apache.org/licenses/LICENSE-2.0'>license</a> <a rel='tag' href='http://myblog.com/category/games'>games posts</a> ...
<a href='http://www.ftd.com' ping='/gen_204?loginfo'>FTD.COM - Flowers</a>
<ul id='tree' role='tree' tabindex='0' aria-labelledby='tree-label'> <li role='treeitem' tabindex='-1' aria-expanded='true'>Fruits</li> <li role='group'> <ul> <li role='treeitem' tabindex='-1'>Oranges</li> <li role='treeitem' tabindex='-1'>Pineapples</li> ... </ul> </li> </ul>
<div itemscope itemtype='http://example.org/band'> <p>My name is <span itemprop='name'>Neil</span>.</p> <p>My band is called <span itemprop='band'>Four Parts Water</span>.</p> <p>I am <span itemprop='nationality'>British</span>.</p> </div>
@font-face { font-family: 'VitesseSans-Light'; src: url(fonts/VitesseSans-Light.otf); } @font-face { font-family: 'VitesseSans-Book'; src: url(fonts/VitesseSans-Book.otf); } @font-face { font-family: 'VitesseSans-Medium'; src: url(fonts/VitesseSans-Medium.otf); } header { font-family: 'VitesseSans-Book'; }
div { text-overflow: ellipsis; }
wbr
s manually here
and there.
div { word-wrap: break-word; }
-webkit-column-count: 2;
-webkit-column-rule: 1px solid #bbb;
-webkit-column-gap: 2em;
In March 1936, an unusual confluence of forces occurred in Santa Clara County.
A long cold winter delayed the blossoming of the millions of cherry, apricot, peach, and prune plum trees covering hundreds of square miles of the Valley floor. Then, unlike many years, the rains that followed were light and too early to knock the blossoms from their branches.
Instead, by the billions, they all burst open at once. Seemingly overnight, the ocean of green that was the Valley turned into a low, soft, dizzyingly perfumed cloud of pink and white. Uncounted bees and yellow jackets, newly born, raced out of their hives and holes, overwhelmed by this impossible banquet.
Then came the wind.
It roared off the Pacific Ocean, through the nearly uninhabited passes of the Santa Cruz Mountains and then, flattening out, poured down into the great alluvial plains of the Valley. A tidal bore of warm air, it tore along the columns of trees, ripped the blossoms apart and carried them off in a fluttering flood of petals like foam rolling up a beach.
This perfumed blizzard hit Stevens Creek Boulevard, a two-lane road with a streetcar line down its center, that was the main road in the West Valley. It froze traffic, as drivers found themselves lost in a soft, muted whiteout. Only the streetcar, its path predetermined, passed on...
div {
-webkit-text-fill-color: black;
-webkit-text-stroke-color: red;
-webkit-text-stroke-width: 0.00px;
}
rgba
with alpha value whenever you could
use rgb
before.
color: rgba(255, 0, 0, ); background: rgba(0, 0, 255, );
color: hsla( , %, %, );
<div>
s!
border-radius: 0px; border-width: 1px;
background: -webkit-gradient(linear, left top, left bottom, from(#00abeb), to(white), color-stop(0.5, white), color-stop(0.5, #66cc00))
background: -webkit-gradient(radial, 430 50, 0, 430 50, 200, from(red), to(#000))
text-shadow: rgba(0, 0, 0, 0.25) 0px 0px 0px; -webkit-box-shadow: rgba(0, 0, 128, 0.25) 0px 0px 0px; -webkit-box-shadow: inset rgba(0, 0, 0, 0.5) 0px 0px 0px;
box-reflect
,
for an instant “wet floor” effect.
text-shadow: rgba(0, 0, 0, 0.33) 0 0px 0px; background: -webkit-gradient(linear, left top, left bottom, from(rgba(200, 200, 240, 0)), to(rgba(255, 255, 255, 0))); border-radius: 0px; -webkit-box-reflect: below 10px -webkit-gradient(linear, left top, left bottom, from(transparent), to(rgba(255, 255, 255, 0)));
border-width: 31px; -webkit-border-image: url(images/border-image.png) 31 ;
#logo { background: url(logo.gif) center center no-repeat; background-size: ; background-composite: ; }
div { background: url(zippy-plus.png) 10px center no-repeat, url(logo.gif) center center repeat; background-size: 12px, 100px; }
-webkit-mask:
div
s can be
arranged vertically or horizontally (like a table) with just
a change of one CSS property.
.canvas { display: -webkit-box; -webkit-box-orient: ; } .canvas .one, .canvas .two { -webkit-box-flex: 1; } .canvas .three { -webkit-box-flex: 3; }
.canvas { display: -webkit-box; -webkit-box-pack: ; -webkit-box-align: ; }
::-webkit-resizer { background-image: url(resources/resizer.png); background-repeat: no-repeat; background-position: bottom right; } ::-webkit-scrollbar-track:horizontal:disabled:corner-present { margin-right: 5px; } ...
#box.left { margin-left: 0; } #box.right { margin-left: 1000px; } document.getElementById('box').className = 'left'; document.getElementById('box').className = 'right';
#box { -webkit-transition: margin-left 1s ease-in-out; } document.getElementById('box').className = 'left'; document.getElementById('box').className = 'right';
@-webkit-keyframes pulse { from { opacity: 0; font-size: 100%; } to { opacity: 1; font-size: 200%; } } div { -webkit-animation-name: pulse; -webkit-animation-duration: 2s; -webkit-animation-iteration-count: infinite; -webkit-animation-timing-function: ease-in-out; -webkit-animation-direction: alternate; }
-webkit-transform: rotateY(45deg); -webkit-transform: scaleX(25deg); -webkit-transform: translate3d(0, 0, 90deg); -webkit-perspective: 500px;
#threed-example { -webkit-transform: rotateZ(5deg); -webkit-transition: -webkit-transform 2s ease-in-out; } #threed-example:hover { -webkit-transform: rotateZ(-5deg); }
iframe
s, shrunk by 50%. This
way you don’t have to create image thumbnails and keep them
up-to-date manually.
-webkit-transform: scale(0.5); -webkit-transform-origin: 0 0;
-webkit-transform: rotateZ(-90deg); -webkit-transform-origin: 0 0;
First | Second | |
---|---|---|
Greek
|
alpha | beta |
gamma | delta | |
Military
|
alpha | bravo |
charlie | delta |
<audio src='sound.wav'>Audio is not supported.</audio> <video autoplay controls src='movie.mov'></video> document.getElementById('video').play();
canvas
allows you to essentially create your
own image pixel by pixel using JavaScript.
<canvas id='canvas' width='838' height='220'></canvas> <script> var canvasContext = document.getElementById('canvas').getContext('2d'); canvasContext.fillRect(250, 25, 150, 100); canvasContext.beginPath(); canvasContext.arc(450, 110, 100, Math.PI * 1/2, Math.PI * 3/2); canvasContext.lineWidth = 15; canvasContext.lineCap = 'round'; canvasContext.strokeStyle = 'rgba(255, 127, 0, 0.5)'; canvasContext.stroke(); </script>
canvas
.
canvas
.
In HTML5, it becomes a regular citizen of the page, instead
of having to include a separate file. Notice how zooming in
(using CSS transform) does not introduce pixels.
<svg> <circle id='my-circle' class='important' cx='50%' cy='50%' r='100' fill='url(#myGradient)' > </svg>
var el = document.getElementById('section1'); el.focus(); var els = document.getElementByTagName('div'); els[0].focus(); var els = document.getElementsByClassName('section'); els[0].focus();
var els = document.querySelector('table.test > tr > td'); var els = document.querySelectorAll('ul li:nth-child(odd)');
var el = document.activeElement;
.row:nth-child(even) { background: #dde; } .row:nth-child(odd) { background: white; }
div { display: inline-block; }
input[type='text'] { background: #eee; }
:not(.box) { color: #00c; } :not(span) { display: block; }
h3:first-child { ... } div.text > div { ... } h3 + header { ... }
alert()
dialog boxes; currently only supported by Chrome.
if (window.webkitNotifications.checkPermission() == 0) { window.webkitNotifications.createNotification(picture, title, text).show(); } else { window.webkitNotifications.requestPermission(); }
<html manifest='cache-manifest'> <event-source src='server.cgi'>
window.applicationCache.addEventListener('updateReady', updateReady, false); var online = navigator.onLine;
CACHE MANIFEST # Version 1 CACHE: /html5/src/refresh.png /html5/src/logic.js /html5/src/style.css /html5/src/background.png
var stateObj = { foo: "bar" }; window.history.pushState(stateObj, "Page 2", "bar.html"); window.onpopstate = function(event) { handleHistoryState(event.state); }
window.sessionStorage['hash'] = hash; window.localStorage.setItem('name', 'Marcin Wichary'); document.getElementById('name').value = window.localStorage.getItem('name'); window.localStorage.removeItem('name');
var database = openDatabase('Database Name', 'Database Version'); database.executeSql('SELECT * FROM test', successCallback); database.executeSql('DROP TABLE test', successCallback);
navigator.geolocation.getCurrentPosition(showMap); function showMap(position) { var lat = position.coords.latitude; var long = position.coords.longitude; var alt = position.coords.altitude; var heading = position.coords.heading; var speed = position.coords.speed; }
document.addEventListener('dragstart', function(event) { event.dataTransfer.setData('image/png', getImageRepresentation()); event.dataTransfer.setData('text/html', getTextRepresentation()); }, false);