64
SEMANTIC HTML By Dmitry Pashkevich

Semantic HTML

Embed Size (px)

DESCRIPTION

See the Web version for better experience: http://dpashkevich.github.io/pres-semantichtml A presentation on semantic markup that advocates for a more thoughtful approach to architecting Web content and explains the benefits of it.

Citation preview

Page 1: Semantic HTML

SEMANTIC HTML

By Dmitry Pashkevich

Page 2: Semantic HTML

GOALSThoughtful approach to composing HTMLTreat HTML pages as documentsBetter overall front end code

Page 4: Semantic HTML

Has structure!Front pageTable of contentsIntroductionChaptersConclusionReferences

Page 5: Semantic HTML
Page 6: Semantic HTML
Page 7: Semantic HTML
Page 8: Semantic HTML
Page 9: Semantic HTML

Other elementsHeader & footerFootnotesAsidesDefinitionsTablesFormulas...

Page 10: Semantic HTML

WORLD WIDE WEB

Page 13: Semantic HTML

Deep nesting

Page 14: Semantic HTML

High dynamicity

Page 15: Semantic HTML

Many representations

Page 16: Semantic HTML

Still documents

Page 17: Semantic HTML

Lots of them!

Page 18: Semantic HTML

Fundamental concept behind WWW

HYPERTEXT

Page 19: Semantic HTML

Plenty of texts with links between them

The Idea

Page 20: Semantic HTML

Extend, connect, share

Page 21: Semantic HTML

The language?HyperText Markup Language

Page 22: Semantic HTML

THE WEB TRIFORCE

Page 23: Semantic HTML

HTML DOCUMENTSComposed of elements

<html> <!-- ROOT ELEMENT --> <head> <!-- METADATA: title, author, description, etc. --> </head>

<body> <!-- PAYLOAD CONTENT --> </body></html>

Page 24: Semantic HTML

ELEMENT ORDERMATTERS!

Search enginesMobile browsingKeyboard navigationFind in page

Page 26: Semantic HTML

ELEMENT ORDER

Page 27: Semantic HTML

ELEMENT ORDER

Page 28: Semantic HTML

Are the essence of the World Wide Web

LINKS

Page 29: Semantic HTML

Hyperlinks

<a href="/cats.html">Please don't break my href!</a>

Page 30: Semantic HTML

Links to external resources

<link rel="shortcut icon" href="/favicon.ico"><link rel="apple-touch-icon" href="/touch-icon.png"><link rel="stylesheet" href="/styles/main.css">

… used to augment the current document,generally automatically processed by theuser agent.

Page 31: Semantic HTML

Other uses of link

Page 32: Semantic HTML

AUTHOR

Page 33: Semantic HTML

SITE SEARCH

Page 34: Semantic HTML

NEWS FEED

Page 35: Semantic HTML

ALSO...

Alternate languagePrevious/next pageLicensePDF version

for moreSee the spec

Page 36: Semantic HTML

HTML5Simplified syntaxNew elements and attributesNew APIPrecisely defined parsing rules,including error behavior

Page 37: Semantic HTML

New elementssection, article, aside, navheader, footerfigure, figcaptiontime, meter, progress, markaudio, video, canvas

Full list

Page 38: Semantic HTML

Not enough elements?

Page 39: Semantic HTML

Not enough elements?Are you sure?

Page 40: Semantic HTML

Not enough elements?Are you sure?

Use the class attribute

Page 41: Semantic HTML

Sections

Each section is like a mini-document

Page 42: Semantic HTML

New input typessearch, email, url, tel,number,

range, colordate, month, week,

time, datetime, datetime-localSee examples

Page 43: Semantic HTML

Input: not just text!

<input type="file" accept="image/*;capture=camera"> <!-- also: camcorder, microphone -->

Demo

Page 44: Semantic HTML

BENEFITS OF SEMANTICMARKUP

Page 45: Semantic HTML

Better read by programsScreen readersSearch enginesSharing toolsContent clippersNews grabbers...

Page 46: Semantic HTML

Easier to change presentation

Page 47: Semantic HTML

Reusability across projects<section class="carousel"> <h1>Featured Content</h1>

<article class="slide"> <h2>Slide Title</h2> <div class="slide-content"> ... </div> </article>

<article class="slide"> <h2>Slide Title</h2> <div class="slide-content"> ... </div> </article></section>

More great patterns from Anthony Ticknor

Page 48: Semantic HTML

Improves your JS too

Page 49: Semantic HTML

DEMO: CSS-TRICKS.COM

Page 50: Semantic HTML

Mobile view

Page 51: Semantic HTML

Mobile view (with navigation)

Page 52: Semantic HTML

Print

Page 53: Semantic HTML

Evernote Clipped Article

Page 54: Semantic HTML

Search result snippet (article)

Page 55: Semantic HTML

Search result snippet (home)

Page 56: Semantic HTML

Google Plus Share

Page 57: Semantic HTML

TAKEAWAYS

Page 58: Semantic HTML

Be responsible about IA*Your HTML = your IA

Page 59: Semantic HTML

Hyperlinks are important!Don't break their functionality!

Page 60: Semantic HTML

Experiment, make mistakes

Page 61: Semantic HTML

Follow the standards

Page 62: Semantic HTML

Stuff gets obsolete