33

SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your
Page 2: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your
Page 3: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your
Page 4: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your
Page 5: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

Browser Support

Page 6: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your
Page 7: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

Syntax

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"

"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<meta http-equiv="content-type" content="text/html;

charset=UTF-8">

<title>HTML OldSkool</title>

<link type="text/css" rel="stylesheet" href="oldskool.css“>

<script type="text/javascript" src="oldskool.js"></script>

</head>

<body>

<h1>Welcome to HTML OldSkool</h1>

</body>

</html>

<!DOCTYPE html>

<html>

<head>

<meta charset=“UTF-8">

<title>HTML5</title>

<link rel="stylesheet" href=“awesome.css“>

<script src=“awesome.js"></script>

</head>

<body>

<h1>Welcome to HTML5</h1>

</body>

</html>

Page 8: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

Congratulations!

Page 9: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your
Page 10: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

HTML5 Elements

Article

Header

Footer

Aside

Section

Nav

Dialog

Figure

HTML5 Document:

Page 11: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

Example Header and Footer<!doctype html>

<html>

<body>

<header id="header">

</header>

<div id=“maincontent”></div>

<footer id="footer">

<ul>

<li><a href="http://www.mavention.nl">Mavention</a></li

</ul>

</footer>

</body>

</html>

Page 12: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

Example Document Elements<!doctype html>

<html>

<body>

<section id="content" role="main">

<article id="maincontent">

<h1>Dutch Information Worker User Group</h1>

<p> ... </p>

</article>

<aside>

<section class="widget">

<h1>DIWUG on twitter</h1>

</section>

</aside>

</section>

</body>

</html>

Page 13: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

Example Navigation<!doctype html>

<html>

<body>

<nav role="navigation">

<ul id="mainnavigation">

<li><a href="/pages/upcoming-event.aspx">Upcoming Event</a></li>

<li><a href="/e-magazines/pages/default.aspx">eMagazines</a></li>

<li><a href="/pages/event-history.aspx">Event History</a></li>

<li><a href="/pages/about-diwug.aspx">About DIWUG</a></li>

<li><a href="/pages/event-full.aspx">Event full</a></li>

</ul>

</nav>

</body>

</html>

Page 14: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

Figure element<!doctype html>

<html>

<body>

<figure>

<img src="img_pulpit.jpg" alt="The Pulpit Rock" width="304" height="228">

<figcaption>Fig1. - A view of the pulpit rock in Norway.</figcaption>

</figure>

</body>

</html>

Page 15: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your
Page 16: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

Media Elements

Video Audio

HTML5 Video and Audio

Page 17: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

Video Elements - Example

<video poster="movieposter.png" autoplay loop controls >

<source src="movie.webm" type="video/webm" />

<source src="movie.mp4" type="video/mp4" />

<source src="movie.ogv" type="video/ogg" />

Your browser does not support the HTML5 video tag

</video>

Page 18: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

Audio Elements - Example

<audio src=“Scooter_Friends.mp3” preload=“auto” autoplay loop controls>

Your browser does not support the HTML5 audio tag

</audio>

<audio autoplay loop controls>

<source src=“hyperhyper.mp3" type=“audio/mpeg" />

<source src="hyperhyper.wav" type=“audio/wav" />

<source src="hyperhyper.ogg" type=“audio/ogg" />

Your browser does not support the HTML5 audio tag

</audio>

Page 19: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your
Page 20: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your
Page 21: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your
Page 22: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

Must start with : data-

User Defined Attributes

<div class="example" data-subject="physics" data-level="complex">

...

</div>

<img src=“federer.png” data-category=“tennis” />

Page 23: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

Microdata

Microdata is a standardized way to provide additional semantics in your web

pages.

Major search engines like Google, Microsoft and Yahoo! rely on this markup to

improve search results

Microdata introduces five global attributes which would be available for any

element to use and give context about your data.

Page 24: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

MicrodataAttribute Description

itemscope Creates the Item and indicates that descendants of this

element contain information about it

itemtype This attribute is a valid URL which defines the item and

provides the context for the properties

itemid This attribute is global identifier for the item

itemprop This attribute defines a property of the item

itemref This attribute gives a list of additional elements to crawl

to find the name-value pairs of the item

Page 25: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

Microdata Example<div>

My name is Octavie van Haaften, but friends call me Big-O. This is my blog:

<a href="http://blog.octavie.nl">blog.octavie.nl</a>

I live in Gorinchem and I work at Mavention as a SharePoint Consultant.

</div>

<div itemscope itemtype="http://data-vocabulary.org/Person">

My name is <span itemprop="name">Octavie van Haaften</span>, but friends

call me <span itemprop="nickname">Big-O</span>. This is my blog:

<a href="http://blog.octavie.nl" itemprop="url">blog.octavie.nl</a>

I live in Gorinchem and I work at Mavention as a <span

itemprop="title">SharePoint Consultant</span>.

</div>

Page 26: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your
Page 27: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

Forms 2.0

Page 28: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

New form elements and attributes

<input list="browsers">

<datalist id="browsers">

<option value="Internet Explorer">

<option value="Firefox">

<option value="Chrome">

<option value="Opera">

<option value="Safari">

</datalist>

Page 29: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

New HTML5 input elementsType Description

Datetime A date and time with the time zone set to

UTC

Datetime-local A date and time with no time zone set

Date A date

Month A date consisting of a year and a month

Week A date consisting of a year and a week

number

Time A time

Number This accepts only numerical value. The step

attribute specifies the precision, defaulting to

1

Type Description

Range The range type is used for input fields that should

contain a value from a range of numbers

Email This accepts only email value

url This accepts only URL value

Color A color picker

Search For search key words

Tel This accepts telephone numbers

Page 30: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your

New HTML5 input attributes

autofocus

• placeholder

• required

Page 31: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your
Page 32: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your
Page 33: SharePoint Fastlane - MS Solution Workshopblog.octavie.nl/wp-content/uploads/2013/03/HTML5-Semantics.pdf · Microdata is a standardized way to provide additional semantics in your