SlideShare a Scribd company logo
QUALITY DEVELOPMENT
WITH HTML5


Shay Howe
September 2011
www.shayhowe.com – @letscounthedays
SHAY HOWE
               www.shayhowe.com – @letscounthedays




Quality Development with HTML5 & CSS3                @letscounthedays
HTML5                              CSS3
  Markup language to give               Presentation language to
   content structure and                 give content style and
         meaning.                             appearance.




Quality Development with HTML5 & CSS3                    @letscounthedays
Quality Development with HTML5 & CSS3   @letscounthedays
HTML5
Quality Development with HTML5 & CSS3   @letscounthedays
HTML5 IS SIMPLE



Quality Development with HTML5 & CSS3   @letscounthedays
DOCTYPE
HTML
<!DOCTYPE	
  html	
  PUBLIC	
  "-­‐//W3C//DTD	
  HTML	
  4.01	
  
  Transitional//EN"	
  "http://www.w3.org/TR/
  html4/loose.dtd">

HTML5
<!DOCTYPE	
  html>




Quality Development with HTML5 & CSS3                     @letscounthedays
LANGUAGE
HTML
<html	
  xmlns="http://www.w3.org/1999/xhtml"	
  
  lang="en"	
  xml:lang="en">

HTML5
<html	
  lang="en">




Quality Development with HTML5 & CSS3         @letscounthedays
CHARACTER ENCODING
HTML
<meta	
  http-­‐equiv="Content-­‐Type"	
  content="text/
  html;	
  charset=UTF-­‐8">

HTML5
<meta	
  charset="UTF-­‐8">




Quality Development with HTML5 & CSS3            @letscounthedays
CSS
HTML
<link	
  rel="stylesheet"	
  type="text/css"	
  
  href="file.css">

HTML5
<link	
  rel="stylesheet"	
  href="file.css">




Quality Development with HTML5 & CSS3              @letscounthedays
JAVASCRIPT
HTML
<script	
  type="text/javascript"	
  src="file.js"></
  script>

HTML5
<script	
  src="file.js"></script>




Quality Development with HTML5 & CSS3        @letscounthedays
GETTING STARTED



Quality Development with HTML5 & CSS3   @letscounthedays
GETTING STARTED
HTML5 Shiv
<!-­‐-­‐[if	
  IE]>
  <script	
  src="http://html5shiv.googlecode.com/
         svn/trunk/html5.js"></script>
<![endif]-­‐-­‐>

CSS
article,	
  aside,	
  footer,	
  header,	
  hgroup,	
  nav,	
  
section	
  {
  display:	
  block;
}



Quality Development with HTML5 & CSS3                   @letscounthedays
HTML5 IS SEMANTIC



Quality Development with HTML5 & CSS3   @letscounthedays
NEW ELEMENTS
• article                               • footer     • rt
• aside                                 • header     • ruby
• audio                                 • hgroup     • section
• canvas                                • keygen     • source
• command                               • mark       • summary
• datalist                              • meter      • time
• details                               • nav        • video
• embed                                 • output     • wbr
• figcaption                            • progress
• figure                                • rp




Quality Development with HTML5 & CSS3                          @letscounthedays
STRUCTURAL ELEMENTS
• header
• nav
• article
• section
• aside
• footer




Quality Development with HTML5 & CSS3   @letscounthedays
STRUCTURAL ELEMENTS
<body>
  <header>...</header>
  <nav>...</nav>
  <article>
    <section>...</section>
  </article>
  <aside...</aside>
  <footer>...</footer>
</body>




Quality Development with HTML5 & CSS3   @letscounthedays
STRUCTURAL ELEMENTS




Quality Development with HTML5 & CSS3   @letscounthedays
HGROUP
<header>
  <hgroup>
    <h1>Shay	
  Howe</h1>
    <h2>Man,	
  Myth	
  or	
  Legend</h2>
  </hgroup>
</header>




Quality Development with HTML5 & CSS3       @letscounthedays
HGROUP




Quality Development with HTML5 & CSS3   @letscounthedays
TIME
<time	
  datetime="15:00">3pm</time>

<time	
  datetime="2011-­‐08-­‐24">August	
  24th,	
  2011</
  time>

<time	
  datetime="2011-­‐08-­‐24T15:00">August	
  24th,
	
  	
  2011	
  at	
  3pm</time>

<time	
  datetime="2011-­‐08-­‐24"	
  pubdate>August
	
  	
  24th,	
  2011</time>

<time>2011-­‐08-­‐24</time>


Quality Development with HTML5 & CSS3              @letscounthedays
TIME




Quality Development with HTML5 & CSS3   @letscounthedays
FIGURE & FIGCAPTION
<figure>
  <img	
  src="shay.jpg"	
  alt="Shay	
  Howe">
  <figcaption>Shay	
  Howe	
  the	
  Man</figcaption>
</figure>

<figure>
  <img	
  src="june.jpg"	
  alt="June">
  <img	
  src="july.jpg"	
  alt="July">
  <img	
  src="august.jpg"	
  alt="August">
  <figcaption>Summer	
  Months</figcaption>
</figure>



Quality Development with HTML5 & CSS3            @letscounthedays
FIGURE & FIGCAPTION




Quality Development with HTML5 & CSS3   @letscounthedays
MARK
<h1>Search	
  results	
  for	
  'chicago'</h1>
<ol>
  <li><a	
  href="http://www.shayhowe.com/">
    Shay	
  is	
  from	
  <mark>Chicago</mark>.
  </a></li>
</ol>




Quality Development with HTML5 & CSS3         @letscounthedays
METER
<meter>7	
  out	
  of	
  10	
  stars</meter>

<meter	
  max="10">7	
  stars</meter>

<meter	
  min="0"	
  max="105"	
  low="5"	
  high="65"	
  	
  
	
  	
  optimum="45"	
  value="47">The	
  car	
  is	
  moving	
  at	
  
	
  	
  a	
  decent	
  average	
  mile	
  per	
  hour.</meter>




Quality Development with HTML5 & CSS3                        @letscounthedays
PROGRESS
You	
  are	
  <progress>50%</progress>	
  complete.

<progress	
  min="0"	
  max="100"	
  value="50">Hold	
  
	
  	
  tight,	
  your	
  getting	
  there.</progress>




Quality Development with HTML5 & CSS3              @letscounthedays
AUDIO



Quality Development with HTML5 & CSS3           @letscounthedays
AUDIO
<audio	
  src="song.mp3"></audio>

<audio	
  src="song.mp3"	
  autoplay	
  controls	
  loop	
  
	
  	
  preload="auto"></audio>




Quality Development with HTML5 & CSS3                 @letscounthedays
AUDIO CONTROLS
<audio	
  id="player"	
  src="song.mp3"></audio>
<div>
   <button	
  onclick="document.getElementById('player').play()">
      Play
   </button>
   <button	
  onclick="document.getElementById('player').pause()">
         Pause
   </button>
   <button	
  onclick="document.getElementById('player').volume	
  +=	
  0.1">
         Volume	
  Up
   </button>
   <button	
  onclick="document.getElementById('player').volume	
  -­‐=	
  0.1">
         Volume	
  Down
   </button>
</div>




Quality Development with HTML5 & CSS3                                 @letscounthedays
AUDIO FALLBACKS
<audio	
  controls>
  <source	
  src="song.ogg"	
  type="audio/ogg">
  <source	
  src="song.mp3"	
  type="audio/mpeg">
  <object	
  type="application/x-­‐shockwave-­‐flash"	
  
    data="player.swf?soundFile=song.mp3">
      <param	
  name="movie"
           value="player.swf?soundFile=wild-­‐
           thing.mp3">
      <a	
  href="song.mp3">Download	
  song</a>
  </object>
</audio>




Quality Development with HTML5 & CSS3               @letscounthedays
VIDEO



Quality Development with HTML5 & CSS3           @letscounthedays
VIDEO
<video	
  src="movie.mp4"	
  controls	
  height="390"	
  
  width="640"></video>

<video	
  src="movie.mp4"	
  controls	
  height="390"	
  
	
  	
  width="640"	
  poster="image.jpg"></video>




Quality Development with HTML5 & CSS3              @letscounthedays
FORMS



Quality Development with HTML5 & CSS3           @letscounthedays
NEW INPUTS
• color                                 • range
• date                                  • search
• datetime                              • tel
• datetime-­‐local                      • time
• email                                 • url
• month                                 • week
• number




Quality Development with HTML5 & CSS3              @letscounthedays
COLOR
<input	
  id="color"	
  name="color"	
  type="color">




Quality Development with HTML5 & CSS3           @letscounthedays
DATE & TIME
• date:	
  2011-­‐08-­‐24
• datetime:	
  2011-­‐08-­‐24T12:00:00+01	
  
• datetime-­‐local:	
  2011-­‐08-­‐24T12:00:00
• month:	
  2011-­‐08
• time:	
  12:00:00
• week:	
  2011-­‐W34


<input	
  id="birthday"	
  
  name="birthday"	
  
  type="datetime-­‐local">




Quality Development with HTML5 & CSS3            @letscounthedays
DATE & TIME




Quality Development with HTML5 & CSS3   @letscounthedays
EMAIL
<input	
  id="email"	
  name="email"	
  type="email">




Quality Development with HTML5 & CSS3           @letscounthedays
EMAIL




Quality Development with HTML5 & CSS3   @letscounthedays
NUMBER
<input	
  id="cost"	
  name="cost"	
  type="number"	
  
  min="10"	
  max="100">




Quality Development with HTML5 & CSS3              @letscounthedays
RANGE
<input	
  id="rating"	
  name="rating"	
  type="range"	
  
  min="1"	
  max="10">




Quality Development with HTML5 & CSS3              @letscounthedays
SEARCH
<input	
  id="query"	
  name="query"	
  type="search">




Quality Development with HTML5 & CSS3           @letscounthedays
TEL
<input	
  id="phone"	
  name="phone"	
  type="tel">




Quality Development with HTML5 & CSS3            @letscounthedays
TEL




Quality Development with HTML5 & CSS3   @letscounthedays
URL
<input	
  id="website"	
  name="website"	
  type="url">




Quality Development with HTML5 & CSS3           @letscounthedays
URL




Quality Development with HTML5 & CSS3   @letscounthedays
NEW ATTRIBUTES
• autocomplete                          • min
• autofocus                             • multiple
• formaction                            • novalidate
• formenctype                           • pattern
• formmethod                            • placeholder
• formnovalidate                        • readonly
• formtarget                            • required
• list                                  • spellcheck
• max                                   • step




Quality Development with HTML5 & CSS3                   @letscounthedays
AUTOCOMPLETE
<form	
  action="#"	
  autocomplete="off">

<input	
  id="destination"	
  name="destination"	
  
	
  	
  type="text"	
  autocomplete="off">




Quality Development with HTML5 & CSS3            @letscounthedays
AUTOFOCUS
<input	
  id="name"	
  name="name"	
  type="text"	
  
	
  	
  autofocus>




Quality Development with HTML5 & CSS3               @letscounthedays
DATALIST
<input	
  id="city"	
  name="city"	
  type="city"	
  
	
  	
  list="cities">
<datalist	
  id="cities">
       <option	
  value="Chicago">
       <option	
  value="Los	
  Angeles">
       <option	
  value="New	
  York">
</datalist>




Quality Development with HTML5 & CSS3               @letscounthedays
MIN, MAX & STEP
<input	
  id="score"	
  name="score"	
  type="number"	
  
  min="0"	
  max="10"	
  step="2">




Quality Development with HTML5 & CSS3              @letscounthedays
PLACEHOLDER
<input	
  id="destination"	
  name="destination"	
  
  type="text"	
  placeholder="Your	
  destination">




Quality Development with HTML5 & CSS3          @letscounthedays
PLACEHOLDER




Quality Development with HTML5 & CSS3   @letscounthedays
REQUIRED
<input	
  id="name"	
  name="name"	
  type="text"	
  
	
  	
  required>




Quality Development with HTML5 & CSS3               @letscounthedays
REQUIRED




Quality Development with HTML5 & CSS3   @letscounthedays
PATTERN
<input	
  id="phone"	
  name="phone"	
  type="tel"	
  
  pattern="^[0-­‐9]+[-­‐	
  ]*[0-­‐9]+$">




Quality Development with HTML5 & CSS3               @letscounthedays
PATTERN




Quality Development with HTML5 & CSS3   @letscounthedays
CHANGED ELEMENTS



Quality Development with HTML5 & CSS3   @letscounthedays
A
OLD
<p><a	
  href="http://www.shayhowe.com/">Shay	
  
	
  	
  Howe</a>	
  is	
  a	
  front-­‐end	
  web	
  designer	
  and	
  
	
  	
  developer.</p>

NEW
<a	
  href="http://www.shayhowe.com/">
  <h1>Shay	
  Howe</h1>
  <p>Front-­‐end	
  web	
  designer	
  and	
  developer.</p>
</a>




Quality Development with HTML5 & CSS3                              @letscounthedays
B
OLD
Text rendered as bold.

NEW
Text stylistically offset without importance.




Quality Development with HTML5 & CSS3           @letscounthedays
CITE
OLD
Reference to another source.

NEW
Specifically a reference to a title of work.




Quality Development with HTML5 & CSS3          @letscounthedays
HR
OLD
Render a horizontal rule.

NEW
A paragraph-level thematic break.




Quality Development with HTML5 & CSS3   @letscounthedays
I
OLD
Text rendered as italic.

NEW
Text in an alternative voice or tone.




Quality Development with HTML5 & CSS3   @letscounthedays
MENU
OLD
A single column menu list.

NEW
A group of controls, most commonly used within web
applications.




Quality Development with HTML5 & CSS3         @letscounthedays
S
OLD
Text rendered with a line through it.

NEW
Text struck from the content that is no longer accurate or
relevant.




Quality Development with HTML5 & CSS3             @letscounthedays
SMALL
OLD
Text rendered as small.

NEW
Text within side comments or small print.




Quality Development with HTML5 & CSS3       @letscounthedays
OBSOLETE ELEMENTS
     & ATTRIBUTES


Quality Development with HTML5 & CSS3   @letscounthedays
OBSOLETE ELEMENTS
• acronym                               • frame
• applet                                • frameset
• basefont                              • isindex
• big                                   • noframes
• center                                • strike
• dir                                   • tt
• font                                  •u


Deprecated from HTML 4.0




Quality Development with HTML5 & CSS3                @letscounthedays
OBSOLETE ATTRIBUTES
• align                                 • frame         • profile
• alink                                 • frameborder   • scrolling
• background                            • hspace        • shape
• bgcolor                               • link          • size
• border                                • name          • target
• cellpadding                           • nohref        • text
• cellspacing                           • noshade       • type
• coords                                • nowrap        • valign




Quality Development with HTML5 & CSS3                             @letscounthedays
HOMEWORK
Microformats
hAtom, hCalendar, hCard, hReview

WAI-ARIA Roles
banner, complementary, contentinfo, main, navigation,
search




Quality Development with HTML5 & CSS3          @letscounthedays
QUESTIONS?
                                        Thank you!




Quality Development with HTML5 & CSS3                @letscounthedays

More Related Content

Quality Development with HTML5