TREINAMENTOS
O QUE VEREMOS?
Uma breve histria do HTML Estrutura de um documento HTML5 Comparao entre HTML4/XHTML e HTML5 Apresentar a especicao Descobrir as novas possibilidades
TREINAMENTOS
O QUE NO VEREMOS?
Cdigo e mais cdigo Explicao detalhada de uso das APIs Exemplos de Elementos e ou APIs que no foram implementados por nenhum browser Explicaes passo a passo de tcnicas de como tentar tornar um browser compatvel com o HTML5
TREINAMENTOS
Gerao de desenvolvedores preocupados com cdigo vlido e bem estruturado. Quebraria a compatibilidade com browsers mais antigos
TREINAMENTOS
W3C
WHATWG
2009: W3C direciona os esforos para o HTML5 2010 ~ 2011: Suporte ao HTML5 aumenta a cada release dos browsers.
TREINAMENTOS
HTML5: ESTRUTURA
Vamos comear pelo comeo e por aquilo que ningum lembra de cabea como se ecreve: DOCTYPE
HTML 4.01
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
TREINAMENTOS
HTML5: ESTRUTURA
Vamos comear pelo comeo e por aquilo que ningum lembra de cabea como se ecreve: DOCTYPE
HTML 4.01
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
XHTML 1.0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
TREINAMENTOS
HTML5: ESTRUTURA
Vamos comear pelo comeo e por aquilo que ningum lembra de cabea como se ecreve: DOCTYPE
HTML5
<!doctype html>
TREINAMENTOS
HTML5: ESTRUTURA
HTML 4.01
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
TREINAMENTOS
HTML5: ESTRUTURA
HTML 4.01
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
XHTML
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
TREINAMENTOS
HTML5: ESTRUTURA
HTML 4.01
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
XHTML
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
HTML5
<meta charset="utf-8">
Wednesday, May 25, 2011
TREINAMENTOS
HTML5: ESTRUTURA
TREINAMENTOS
HTML5: ESTRUTURA
TREINAMENTOS
HTML5: ESTRUTURA
HEIN?!
Wednesday, May 25, 2011
TREINAMENTOS
HTML5: ESTRUTURA
<html xmlns="http://www.w3.org/ 1999/xhtml" xml:lang="pt-BR"> <head> <meta charset="utf-8" /> <title>Ttulo</title> </head> <body> <p>Texto simples.</p> </body> </html>
TREINAMENTOS
HTML5: ESTRUTURA
<html xmlns="http://www.w3.org/ 1999/xhtml" xml:lang="pt-BR"> <head> <meta charset="utf-8" /> <title>Ttulo</title> </head> <body> <p>Texto simples.</p> </body> </html>
TREINAMENTOS
TREINAMENTOS
TREINAMENTOS
TREINAMENTOS
TREINAMENTOS
TREINAMENTOS
TREINAMENTOS
De acordo com a especicao do HTML 4.01: The DIV and SPAN elements, in conjunction with the id and class attributes, offer a generic mechanism for adding structure to documents. These elements dene content to be inline (SPAN) or block-level (DIV) but impose no other presentational idioms on the content. Thus, authors may use these elements in conjunction with style sheets, the lang attribute, etc., to tailor HTML to their own needs and tastes.
TREINAMENTOS
De acordo com a especicao do HTML 4.01: The DIV and SPAN elements, in conjunction with the id and class attributes, offer a generic mechanism for adding structure to documents. These elements dene content to be inline (SPAN) or block-level (DIV) but impose no other presentational idioms on the content. Thus, authors may use these elements in conjunction with style sheets, the lang attribute, etc., to tailor HTML to their own needs and tastes. HEIN?! Inline?! Block-level?! Calma...
Wednesday, May 25, 2011
TREINAMENTOS
TREINAMENTOS
Exemplo:
<i>: formata um texto em itlico apresentao <em>: indica que o texto deve ser enfatizado signicado <cite>: indica uma citao signicado
TREINAMENTOS
TREINAMENTOS
TREINAMENTOS
O elemento <div> no possui signicado e, por padro, no afeta a apresentao. Mais uma olhadinha na especicao do HTML 4.01: The DIV and SPAN elements, in conjunction with the id and class attributes, offer a generic mechanism for adding structure to documents. These elements dene content to be inline (SPAN) or block-level (DIV) but impose no other presentational idioms on the content. Thus, authors may use these elements in conjunction with style sheets, the lang attribute, etc., to tailor HTML to their own needs and tastes.
Wednesday, May 25, 2011
TREINAMENTOS
TREINAMENTOS
<header> <post>
<sidebar>
<post> <footer>
Wednesday, May 25, 2011
TREINAMENTOS
Por qu?
TREINAMENTOS
Por qu?
Dois motivos bem simples: 1 - obviamente, escreve-se menos 2 - traria signicado ao contedo
Wednesday, May 25, 2011
TREINAMENTOS
Legal... e da?
TREINAMENTOS
TREINAMENTOS
HTML5: ESTRUTURA
TREINAMENTOS
<header> <article>
<aside>
As tags <post> e <sidebar> que utilizamos na nossa situao perfeita no existem. No lugar delas utilizamos as tags <article> e <aside> que so mais genricas, anal seria impossvel existirem tags para para todo tipo de site com diversos temas diferentes, no mesmo?
<article> <footer>
Wednesday, May 25, 2011
TREINAMENTOS
UM POUCO DE ESTATSTICA
Analysis of Variance
2 2 ___ BSS n j X j M X j nj 2 ___ 2 WSS = X n 1 s ij X j j j
2 T
XT
X
2
XT
Xj
N
nj
TSS = N -1 s
2 T
X
ij
M
F df b k
NOTE:
1, df w n k, df t n 1
TREINAMENTOS
UM POUCO DE ESTATSTICA
Analysis of Variance
2 2 ___ BSS n j X j M X j nj 2 ___ 2 WSS = X n 1 s ij X j j j
2 T
XT
X
2
N
XT
?!
Xj
nj
TSS = N -1 s
2 T
X
ij
M
F df b k
NOTE:
1, df w n k, df t n 1
TREINAMENTOS
UM POUCO DE ESTATSTICA
Analysis of Variance
2 2 ___ BSS n j X j M X j nj 2 ___ 2 WSS = X n 1 s ij X j j j
2 T
XT
X
2
XT
Xj
N
nj
TSS = N -1 s
2 T
X
ij
M
F df b k
NOTE:
1, df w n k, df t n 1
TREINAMENTOS
UM POUCO DE ESTATSTICA
Valores populares para o atributo id
Total: 1.782.769
Fonte: Opera MAMA crawler http://dev.opera.com/articles/view/mama-common-attributes/ MAMA - Metadata Analysis and Mining Application
TREINAMENTOS
UM POUCO DE ESTATSTICA
Valores populares para o atributo class
Total: 2.139.184
Fonte: Opera MAMA crawler http://dev.opera.com/articles/view/mama-common-attributes/ MAMA - Metadata Analysis and Mining Application
TREINAMENTOS
UM POUCO DE ESTATSTICA
Coincidncia alguns desses nomes serem os mesmos que os utilizados em alguns dos novos elementos do HTML5?
TREINAMENTOS
UM POUCO DE ESTATSTICA
Coincidncia alguns desses nomes serem os mesmos que os utilizados em alguns dos novos elementos do HTML5?
No
Wednesday, May 25, 2011
TREINAMENTOS
UM POUCO DE ESTATSTICA
Lembra que eu disse que o processo de especicao do HTML5 era diferente? Eu disse que era: Aberto Qualquer um pode participar da lista de e-mail do WHATWG Emprico Os responsveis pela especicao no levaram em conta apenas o que era discutido nas listas de e-mail ou o que eles achavam melhor. Eles observaram o comportamento dos desenvolvedores, ou seja, analisaram pginas e mais pginas em busca de um padro.
TREINAMENTOS
De marcao:
TREINAMENTOS
De marcao:
TREINAMENTOS
Mdia:
TREINAMENTOS
Grco:
<canvas>
TREINAMENTOS
Grco:
<canvas>
TREINAMENTOS
Grco:
<canvas>
Bibliotecas para manipular o canvas: gury - http://guryjs.org/ EaselJS - http://easeljs.com/ RGraph - http://www.rgraph.net/ Processing.js - http://processingjs.org/
Wednesday, May 25, 2011
TREINAMENTOS
Formulrio:
TREINAMENTOS
<ol> <dl> <cite> <address> <em>, <i> <strong>, <b> <hr> <small>
TREINAMENTOS
<input type=TIPO>
button checkbox color date datetime datetime-local email le hidden image month number
Wednesday, May 25, 2011
password radio range reset search submit tel text time url week
TREINAMENTOS
<input>
Alguns dos novos atributos para o <input>: list autofocus placeholder required multiple pattern autocomplete* min max step
TREINAMENTOS
<input>
Alguns dos novos atributos para o <input>: list autofocus placeholder required multiple pattern autocomplete* min max step
* The off state indicates either that the control's input data is particularly sensitive (for example the activation code for a nuclear weapon); or that it is a value that will never be reused (for example a one-time-key for a bank login) and the user will therefore have to explicitly enter the data each time, instead of being able to rely on the UA to prell the value for him; or that the document provides its own autocomplete mechanism and does not want the user agent to provide autocompletion values.
TREINAMENTOS
TREINAMENTOS
HTML5: ARMAZENAMENTO
TREINAMENTOS
HTML5: ARMAZENAMENTO
Hoje em dia, como armazenamos dados localmente atravs de um documento HTML? Uma dica... s
TREINAMENTOS
HTML5: ARMAZENAMENTO
Hoje em dia, como armazenamos dados localmente atravs de um documento HTML? COOKIES
Compartilhado com o servidor atravs do cabealho de requisio
Chato de criar, chato de manter e chato de remover Para armazenar estruturas de dados um pouco mais complexas, deve ser serializado primeiro
TREINAMENTOS
HTML5: ARMAZENAMENTO
TREINAMENTOS
Sim
Wednesday, May 25, 2011
TREINAMENTOS
Sim... e No
Utilize o bom senso
Wednesday, May 25, 2011
TREINAMENTOS
Sim... e No
Utilize o bom senso
Wednesday, May 25, 2011
TREINAMENTOS
CSS3
TREINAMENTOS
CSS3
Fazer caixinhas com bordas arredondadas Colocar uma sombrinha nos textos/caixas Utilizar um background gigante Utilizar um background composto Fazer uma pgina adaptvel ao tamanho da tela Fazer os ttulos das pginas ter uma fonte mais style
TREINAMENTOS
TREINAMENTOS
CSS3: SOMBRAS
box-shadow: inset 5px 5px 5px #ff0000; -moz-box-shadow -webki-box-shadow box-shadow: 10px 10px 10px #000000;
TREINAMENTOS
TREINAMENTOS
TREINAMENTOS
TREINAMENTOS
TREINAMENTOS
Como resolvemos hoje o problema dos backgrounds compostos? <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div> <div>
Wednesday, May 25, 2011
TREINAMENTOS
Como resolvemos hoje o problema dos backgrounds compostos? Soluo: Mltiplas declaraes de background.
TREINAMENTOS
Como resolvemos o problema das pginas com aparncias diferentes para tamanhos diferentes de tela?
TREINAMENTOS
Como resolvemos o problema das pginas com aparncias diferentes para tamanhos diferentes de tela? Antes do CSS3: @media screen { p { font-family: sans-serif } } <link rel="stylesheet" media="print" href="..." />
TREINAMENTOS
Como resolvemos o problema das pginas com aparncias diferentes para tamanhos diferentes de tela? Antes do CSS3: @media screen { p { font-family: sans-serif } } <link rel="stylesheet" media="print" href="..." /> CSS3: @media all and (min-width:500px) { ... } @media print and (orientation: portrait) { ... } <link rel="stylesheet" media="print and (min-width: 25cm)" href="..." />
Wednesday, May 25, 2011
TREINAMENTOS
TREINAMENTOS
E as fontes diferentes das que no so as do padro web? Como era feito at hoje? Imagem esttica SIFR (Scalable Inman Flash Replacement) Cufn Imagem dinmica (ex: FLIR)
TREINAMENTOS
E as fontes diferentes das que no so as do padro web? Como era feito at hoje? Imagem esttica SIFR (Scalable Inman Flash Replacement) Cufn Imagem dinmica (ex: FLIR)
TREINAMENTOS
TREINAMENTOS
TREINAMENTOS
CSS3: SELETORES
TREINAMENTOS
CSS3: SELETORES
TREINAMENTOS
CSS3: PSEUDO-CLASSES
Novas pseudo-classes:
E:root E:nth-child(n) E:nth-last-child(n) E:nth-of-type(n) E:nth-last-of-type(n) E:last-child E:rst-of-type E:last-of-type E:only-child E:only-of-type E:empty E:enabled E:checked E:not(s)
Wednesday, May 25, 2011