for Android and Nokia
code is monospace
bold italic gray for old code
orange dotted underlined transitional code
bold fuchsia for new or recommended code
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html>
<meta
http-equiv="content-type" content="text/html;
charset=utf-8">
<meta charset="utf-8">
<!DOCTYPE html>
<meta charset="utf-8">
<title> Hello </title>
<p> World Wide Web </p>
<plaintext>
→ use <pre>
instead<basefont> <big> <font> <tt>
→ use CSS font
<strike> <u>
→ text-decoration
<center>
align
→ text-align
and margin:auto
link, alink, vlink
→ pseudo-classes and color
<img longdesc>
- use a visible description or link<frameset> <frame>
<iframe>
if necessary<html version>
- no practical effect<meta scheme>
- avoid invisible metadata
rev
attribute - oft misunderstood.
rel
microformats instead<script type="text/javascript">
<a href="..."><img border="0"></a>
<br/>
<embed/>
<hr/>
<img/>
<input/>
<link/>
<meta/>
<img src=photo1.jpg>
→ <img src="photo1.jpg" />
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title> ... </title>
</head>
<body> ... </body>
</html>
<table>
<tbody>
<tr>
<td> ... </td>
</tr>
</tbody>
</table>
<acronym>
→ use <abbr>
instead<applet>
→ <object>
<dir>
→ <ul>
<a name="a1"></a>
→ <div id="a1"> ... </div>
<img name="i1">
→ <img id="i1" />
<em>
- nest to indicate stronger emphasis<strong>
- importance rather than emphasis<small>
- small print, disclaimer, caveat, copyright<i>
- alternate voice/mood. technical term, idiom<b>
- stylistically offset. keyword, product, lead<s>
- no longer accurate or relevant<br>
- line break, e.g. in poems, addresses<hr>
- paragraph level thematic break<iframe>
for nested HTML<embed>
for plugins<base target>, <a target>, <area target>
<li value>
<ol start>
<ol>
, <ul>
may have zero items<ol reversed>
New!<cite>
- HTML4 allowed speaker names
<cite>
+ hCard for speakers:
<q cite="#ak">
The best way to predict the future is to invent it.
</q>
— <cite class="vcard" id="ak">
<span class="fn">
Alan Kay
</span>
</cite>
<a>
can now surround blocks, e.g. post headings
<a rel="bookmark" href="...">
<h2>title of a blog post, linked to its permalink</h2>
</a>
class, dir, id, lang, style, tabindex, title
<html>
, <title>
elements<a media>, <area media>
just like <link media>
<a media="handheld" href="http://m.twitter.com" rel="alternate">
mobile site
</a>
<a media="print" href="http://example.com/article-print" rel="alternate">
print version
</a>
<area hreflang rel>
like <a hreflang rel>
rel
for microformatsrev
, longdesc
, frame
, version
, scheme
id
attribute, <abbr>
, <object>
, <ul>
<em> <strong>
<small> <i> <b> <s> <br> <hr>
<iframe> <embed> <li value> <ol start> target
<cite>
+ hCard for speakersclass dir id lang style tabindex title
media rel hreflang
<article>
- self-contained post, news, comment
<header>
- intro, <nav>
, headings<footer>
- info, copyright<aside>
- tangential content, side comments<figure> <figcaption>
- images, captions/descriptions
<hgroup>
- related multilevel headings<time datetime>
- precise dates and date-times
<article><div class="article">
...</div></article>
...
.article { /* article styling here */ }
<article><div class="article hentry">
...</div><article>
<div class="hgroup"><hgroup>
...</hgroup></div>
<ruby>
- annotated East Asian text<rt>
- Ruby Text annotation
<rp>
- Ruby Parenthesis for non-supporting browsers...
<ruby>
漢 <rp>(</rp><rt>かん</rt><rp>)</rp>
字 <rp>(</rp><rt>じ</rt><rp>)</rp>
</ruby>
...
... 漢 (かん) 字 (じ) ...
...
<ruby>
漢 <rp>(</rp><rt>かん</rt><rp>)</rp>
字 <rp>(</rp><rt>じ</rt><rp>)</rp>
</ruby>
...
<article>
: <header> <nav> <footer> <aside>
<figure> <figcaption> <hgroup>
<time>
for dates - beware of limitations
<ruby>
incorporated from XHTML 1.1<svg>
- W3C's vector graphics markup
<canvas>
- drawing with javascript
<audio src></audio>
- like img for sound
<video src></video>
- alternative to video plugins
<source src>
- publish WebM and H.264
<video controls>
<source src="http://example.com/vid.ogv">
<source src="http://example.com/vid.mp4">
<object data="http://example.com/vid.mp4">
<embed src="http://example.com/vid.swf">
</object>
</video>
<object>
<embed>
for older browser fallback<audio src> <video src>
<source src>
for alternatives#!
URLshistory.pushState
- update current URL<input type="...">
<output>
- result of a calculation<details>
- expandable content
<summary>
- label for details<meter>
- % or measurement within a range
min max value
attributes<progress max value>
- task completion
autofocus
attribute - upon page loadplaceholder
attribute - suggestionsrequired
attribute - for form submissionImplementors should be aware that this specification is not stable. Implementors who are not taking part in the discussions are likely to find the specification changing out from under them in incompatible ways.
<hgroup> <footer> history.pushState
.incremental {opacity: 0;}
.incremental,.current {
-moz-transition: opacity .5s linear;
-webkit-transition: opacity .5s linear;
-o-transition: opacity .5s linear;
}