37
HTML 1

Html

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Html

HTML

1

Page 2: Html

Interaction

2

Page 3: Html

Upon this course completion you will have basic knowledge on

• legacy of HTML and CSS

• various versions of HTML and XHTML and mighty html5

• HTML structure & elements

• use of semantic markup

• base tools

• base sources

3

Page 4: Html

Course agenda

1. HTML history and evolution

2. HTML documents structure

3. HTML elements

4. HTML vs XHTML

5. semantic markup

6. HTML5

7. tools

8. Sources + !Sources

4

Page 5: Html

HTML history: origins

• invented in CERN by Tim Berners-Lee

• language based on SGML

5

Page 6: Html

HTML history: version history

• 1993 IETF introduces HTML specification draft

• 1995 first specification - HTML2.0 - by HTMLWG

• 1997 HTML3.2 by W3C. In the same year HTML4.0

๏ 1998 XML1.0 spec & W3C decided that there will be no more no-xml versions of HTML in the future

• 1999 HTML4.01

6

Page 7: Html

• 2000 XHTML 1.0

• 2000 XHTML 1.1

• 2003 Apple and Opera blasts xform 1.0 specs

• 2004 after W3C workshop WHATWG was found and work on HTML5 began

• 2008 first working draft on HTML5

• 2010 NOW - HTML5 5th version of working draft

7

HTML history: version history

Page 8: Html

HTML?

8

• It is

• markup - a way of structuring content

• place to add meta-information for browser to process

• It is not

• programming language

• presentation (styling) layer

Page 9: Html

HTML document structure

9

• three main elements

• we got some tags

• too simple?

Page 10: Html

HTML document structure:tags

10

• just any tag_name? - NO

• “ or ‘ - work both ways but use “

• empty tags? -use shorthand in xhtml <span/>

• case sensitive? NO

• spaces inside tags?omitted

Page 11: Html

HTML : tags - structural

11

• provide structure to content

• containers

• semantic elements

• structure organization

• elements of DOOM

• <br>

• <hr>

Page 12: Html

HTML : tags - list

12

• listing content

• lists

• definition lists

• punctuations

Page 13: Html

HTML : tags - text formatting

13

• text formatting

• inline elements

• links

• code

• citations

• ...

• elements of DOOM

• <i></i>

• <b></b>

• <u></u>

Page 14: Html

HTML : tags - forms

14

• building forms

• different inputs

• description elements

• structure

• kinda no place in here

Page 15: Html

HTML : tags - tables

15

• tables

• they are used for tabular data, nothing else!

• table definition

• rows, cells

• kinda no place in here

Page 16: Html

HTML : tags - media

16

• including media

• audio

• images

• objects

Page 17: Html

HTML : attributes

17

• some common attributes you will find

• ID

• class

• title

• type

• style

Page 18: Html

LETS GET BACK TO HEAD

18

Page 19: Html

HTML <head>

19

• You will put meta information in here

• title

• meta tags

• scripts

• styles

Page 20: Html

HTML problemds on the way

20

• html entities

• charset

• DOCTYPES

Page 21: Html

DOCTYPE

• !DOCTYPE is not HTML tag

• instruction for web browser about document markup language

• refers to Document Type Definition

• artifact from SGML

• will we utilize it? YES!

• sample doctype

21

Page 22: Html

HTML vs XHTML page 1

• HTML๏ case insensitive๏ you can omit end tags

and some start tags๏ you can omit element

attributes quotes <foo attr=value>

๏ use browser HTML parser

๏ some attributes can be expressed without name <input type=”checkbox” checked>

• XHTML๏ case sensitive๏ tags should be lowercase๏ all elements should have

start and end tags๏ requires xml syntax for

empty elements <foo/>

๏ you have to quote element attributes <foo attr=”value”>

๏ xmlns attr in html tag

22

Page 23: Html

HTML vs XHTML page 2

23

• HTML๏ MIME type text/html

• XHTML๏ should have MIME type

application/xhtml+xml๏ certain characters must

appear as named entities & as &amp;

๏ xml:lang should be used instead of lang

๏ some DOM methods and properties may not work innerHTML, onClick

Page 24: Html

XHTML when to use?

• XHTML

๏ want to treat page as XML

๏ use MathML or CML

๏ manage several namespaces

๏ need to validate against strict markup

• HTML

๏ else ... always?

24

Page 25: Html

Semantic markup key questions

• do we need semantic markup? YES

• what are pros of semantic markup?

๏ better SEO

๏ easier to separate content from presentation

๏ clear document structure

๏ W3C standards

• when should we put special emphasis on it?

๏ designing for people with disabilities

๏ designing for wide variety of devices

25

Page 26: Html

Semantic markup principles

• “it validates” != “it is well written”

• design for human first, computers second

• html5lify your code

• do not use deprecated elements

• run from divitis and classitism

• follow usability guides to achieve compliancy with browsers for people with disabilities [f.e. put navigation in lists]

• separate your presentation and structure (style attr is evil!)

26

Page 27: Html

Semantic markup practices

• don’t use html solely for presentation [<br>,<hr>]

• your document should be easily printable without CSS

• non-content images should be provided by CSS [f.e. bullets]

• provide empty alt elements for images without meaning

• in structure use DIVs for block and SPANs for inline

• use tables for tabular data

• build your navigation on lists

• don’t create redundant classes [f.e. ‘link’ for <a>]

27

Page 28: Html

HTML5 motivations

๏ provide not only standard for developers but also processing hints for implementors

๏ back to open process [xhtml 2.0]

๏ give power back to end user

๏ focus on semantic markup

๏ improve accessibility

๏ bring new features to the deck

๏ bring unanimous standard for various devices

28

Page 29: Html

HTML5 design principles

๏ priorities : users > authors > implementors > spec writers

๏ degrade gracefully

๏ support settled practices [f.e.<br/>]

๏ separate content and presentation

๏ protect users

๏ evolution not revolution

๏ provide consistent DOM [for xHTML5 and HTML5]

29

Page 30: Html

HTML5 elements

๏ <header>

๏ <footer>

๏ <nav>

๏ <aside>

๏ <figure>

๏ <legend>

๏ <article>

๏ <section>

30

๏ <video>

๏ <audio>

Structure Media

Form controls

datetime, datetimelocal, date, month, week, time, number, range , email, url , search , color

and client side validation for them

Page 31: Html

HTML5 interoperability and access

๏ well defined behaviors in spec, focus on MUSTS for implementors

๏ provide backward compatibility, even for not valid markup

๏ same behavior, even for non conforming content in different implementations

๏ avoid complexity

๏ handle errors, provide recovery

๏ media access independence [desktop/phone/tv]

๏ heavy support for different languages

๏ heavy support for accessibility

31

Page 32: Html

HTML5 features

๏ cross document communication aka XMLHttpRequest2

๏ server push communication

๏ geolocation api

๏ web storage api

๏ messaging api [sms,mms]

๏ media capture

๏ 2D image input <canvas>

๏ ...

32

Page 33: Html

HTML5

33

IE6 ? YES!

Page 34: Html

Tools

34

• MAC

• panic coda

• textmate

• Dreamweaver

• PC

• notepad++

• dreamweaver

• YOU WILL SEEK FOR

• code syntax coloring

• snippets

• templates

• project files

• folding

• code completion

• ftp support

Page 37: Html

Literature

37


<!doctype html><html><head><script type=