html&css 1 - introduction to html

78

Click here to load reader

Upload: dinis-correia

Post on 15-Nov-2014

1.772 views

Category:

Technology


2 download

DESCRIPTION

Slides for my in-house HTML & CSS trainning at SAPO. The history of (X)HTML, syntax, structure and some semantic elements. Download for correct background colors/textures!

TRANSCRIPT

Page 1: HTML&CSS 1 - Introduction to HTML

CSS&DINIS CORREIA 2011

cbn

1HTML

Page 2: HTML&CSS 1 - Introduction to HTML

DEFINIÇÃO ESTRUTURA CORPO1 2 3HTML

Page 3: HTML&CSS 1 - Introduction to HTML

HTML

DEFINIÇÃO1

Page 4: HTML&CSS 1 - Introduction to HTML

H T M Lyper text arkup anguage

DEFINIÇÃO1

Page 6: HTML&CSS 1 - Introduction to HTML

HTMLBREVE HISTÓRIA

1990 2010

Page 7: HTML&CSS 1 - Introduction to HTML

TIM BERNERS-LEEFOTO DE LE FEVRE COMMUNICATIONS

Page 8: HTML&CSS 1 - Introduction to HTML

HTMLBREVE HISTÓRIA

1990 2010

Page 9: HTML&CSS 1 - Introduction to HTML

HTMLBREVE HISTÓRIA

1990HTML HTTP

Web browserWeb server

Page 10: HTML&CSS 1 - Introduction to HTML

HTMLBREVE HISTÓRIA

1991HTML Tags

Mailing list www-talk

Page 11: HTML&CSS 1 - Introduction to HTML

HTMLBREVE HISTÓRIA

1993Elemento <img>

Código fonte WorldWideWeb

Page 12: HTML&CSS 1 - Introduction to HTML

HTMLBREVE HISTÓRIA

1994Novos browsers

Fundada a W3C

Page 13: HTML&CSS 1 - Introduction to HTML

HTMLBREVE HISTÓRIA

1995HTML 2.0

Microsoft lança IE

Page 14: HTML&CSS 1 - Introduction to HTML

HTMLBREVE HISTÓRIA

1997HTML 3.2

Page 15: HTML&CSS 1 - Introduction to HTML

HTMLBREVE HISTÓRIA

1999HTML 4.01

Page 16: HTML&CSS 1 - Introduction to HTML

HTMLBREVE HISTÓRIA

2008Primeiro draft HTML5

Page 17: HTML&CSS 1 - Introduction to HTML

HTMLBREVE HISTÓRIA

2010Adopção do HTML5

(ainda que não finalizado)

Page 18: HTML&CSS 1 - Introduction to HTML

HTMLBREVE HISTÓRIA

2000 ? 2007

Page 19: HTML&CSS 1 - Introduction to HTML
Page 20: HTML&CSS 1 - Introduction to HTML
Page 21: HTML&CSS 1 - Introduction to HTML
Page 22: HTML&CSS 1 - Introduction to HTML
Page 23: HTML&CSS 1 - Introduction to HTML

HTMLSINTAXE

<p>Um  parágrafo</p>

TAG TAG ABERTURA FECHO

Page 24: HTML&CSS 1 - Introduction to HTML

HTMLSINTAXE

<p>Um  parágrafo</p>

ELEMENTO

Page 25: HTML&CSS 1 - Introduction to HTML

HTMLSINTAXE

<p  class="summary">Um  parágrafo</p>

ATRIBUTO

Page 26: HTML&CSS 1 - Introduction to HTML

HTMLSINTAXE

<p  id="main"  class="summary">Um  parágrafo</p>

ATRIBUTO

ATRIBUTO

Page 28: HTML&CSS 1 - Introduction to HTML

SINTAXE

<p>Um  <strong>parágrafo</strong></p>

ELEMENTOS NESTED

HTML

Page 29: HTML&CSS 1 - Introduction to HTML

ESTRUTURA2HTML

Page 30: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

<!doctype  html><html>

<head><title>Um  título</title>

</head><body>

<p>Um  parágrafo</p></body>

</html>

HTML

BODY

P

HEAD

TITLE

Page 31: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

Page 32: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

<!doctype  html><html>

<head><title>Um  título</title>

</head><body>

<p>Um  parágrafo</p></body>

</html>

HTML

BODY

P

HEAD

TITLE

Page 33: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

<head><title>Um  título</title>

<meta  name="description"  content="A  descrição  da  página"><meta  name="keywords"  content="vídeos,fotos,pesquisa">

<link  type="text/css"  rel="stylesheet"  href="style.css"><script  type="text/javascript"  src="script.js"></script>

</head>

Page 34: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

<head><title>Um  título</title>

<meta  name="description"  content="A  descrição  da  página"><meta  name="keywords"  content="vídeos,fotos,pesquisa">

<link  type="text/css"  rel="stylesheet"  href="style.css"><script  type="text/javascript"  src="script.js"></script>

</head>

Page 35: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

<head><title>Um  título</title>

<meta  name="description"  content="A  descrição  da  página"><meta  name="keywords"  content="vídeos,fotos,pesquisa">

<link  type="text/css"  rel="stylesheet"  href="style.css"><script  type="text/javascript"  src="script.js"></script>

</head>

Page 36: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

Page 37: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

<head><title>Um  título</title>

<meta  name="description"  content="A  descrição  da  página"><meta  name="keywords"  content="vídeos,fotos,pesquisa">

<link  type="text/css"  rel="stylesheet"  href="style.css"><script  type="text/javascript"  src="script.js"></script>

</head>

Page 38: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

<head><title>Um  título</title>

<meta  name="description"  content="A  descrição  da  página"><meta  name="keywords"  content="vídeos,fotos,pesquisa">

<link  type="text/css"  rel="stylesheet"  href="style.css"><script  type="text/javascript"  src="script.js"></script>

</head>

Page 39: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

<!DOCTYPE>

Page 40: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

<!DOCTYPE>1 Rendering mode

2 Validação

Page 41: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

<!doctype  html>

Page 42: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

<!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  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">

Page 43: HTML&CSS 1 - Introduction to HTML

HTMLBREVE HISTÓRIA

2000XHTML 1.0

Page 44: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

<P  class="summary">Um  parágrafo</P>

Page 45: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

<P  CLASS="summary">Um  parágrafo</P>

Page 46: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

<P  CLASS=summary>Um  parágrafo</P>

Page 47: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

<P  CLASS=summary>Um  parágrafo

Page 48: HTML&CSS 1 - Introduction to HTML

HTMLESTRUTURA

<p  class="summary">Um  parágrafo</p>

Page 49: HTML&CSS 1 - Introduction to HTML

CORPO3HTML

Page 50: HTML&CSS 1 - Introduction to HTML

CORPO

1 Block level 2 Inline

HTML

Page 51: HTML&CSS 1 - Introduction to HTML

CORPO

<p>Um  <strong>parágrafo</strong></p>

HTML

Page 52: HTML&CSS 1 - Introduction to HTML

CORPO

<p>        Um  parágrafo        </p>

<p>Um  parágrafo</p>

=

HTML

Page 53: HTML&CSS 1 - Introduction to HTML

CORPO

<h1>    <h2>    <h3>    <h4>    <h5>    <h6>    

HTML

Page 54: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<h1>Notícias</h1>...<h2>Destaques</h2>...<h3>2010  fica  para  a  História  como  um  ano  atribulado</h3>  

Page 55: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<p>O  actor  nasceu  a  7  de  Fevereiro  de  1946,  em  Warrington,  Cheshire,  e  teve  desde  logo  um  promissor  percurso  teatral,  como  actor  e  professor.</p>

<p>Após  vários  papéis  em  televisão,  Postlethwaite  estreou-­‐se  no  cinema  em  1977  num  minúsculo  papel  em  «O  Duelo».</p>

Page 56: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<blockquote  cite="http://www.w3.org/TR/html401/"><p>This  document  obsoletes  previous  versions  of  HTML  4.0,although  W3C  will  continue  to  make  those  specifications  andtheir  DTDs  available  at  the  W3C  Web  site.</p>

</blockquote>

Page 57: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<em>      <strong>

Page 58: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<p><em>Atenção:</em>  o  acesso  é  restrito.</p>

Page 59: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<p><em>A  entrada  não  autorizada  é  <strong>expressamente  proibida.</strong></em></p>

Page 60: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<ol>                  <ul>                  <dl>

ORDENADA NÃOORDENADA

DEFINIÇÃO

Page 61: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<ol><li>Pré-­‐aqueça  o  forno.</li><li>Coloque  o  recipiente  no  forno.</li><li>Deixe  cozinhar  durante  30  min.</li>

</ol>

1. Pré-aqueça o forno.2. Coloque o recipiente no forno.3. Deixe cozinhar durante 30 min.

Page 62: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<ul><li>Pão</li><li>Leite</li><li>Ovos</li>

</ul>

• Pão• Leite• Ovos

Page 63: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<dl><dt>Laranja</dt><dd>Fruto  produzido  pela  laranjeira</dd><dt>Maçã</dt><dd>Fruto  produzido  pela  macieira</dd>

</dl>

LaranjaFruto produzido pela laranjeira

MaçaFruto produzido pela macieira

Page 64: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<ol><li>Capítulo  1</li><li>Capítulo  2

<ol><li>Secção  1</li><li>Secção  2</li>

</ol></li><li>Capítulo  3</li>

</ol>

1. Capítulo 1

2. Capítulo 2

1. Secção 1

2. Secção 2

3. Capítulo 3

Page 65: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<img  src="fotografia.jpg">

HTML

Page 66: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<img  src="fotografia.jpg"  />

XHTML

Page 67: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<img  src="fotografia.jpg"  alt="Vista  para  o  rio">

Page 68: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<img  src="fotografia.jpg"  alt=""  title="Um  local  privilegiado">

Page 69: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<img  src="fotografia.jpg"  alt="Vista  para  o  rio"  title="Um  local  privilegiado"  width="200"  height="140">

Page 70: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<a  href="http://www.sapo.pt">Homepage  do  SAPO</a>

Page 71: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<a  href="http://www.sapo.pt"><img  src="fotografia.jpg"  alt="Vista  para  o  rio"  title="Um  local  privilegiado"  

width="200"  height="140"></a>

Page 72: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<a  href="fotos.html">Página  de  fotos</a>

Page 73: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<table><tr><td>Célula  1</td><td>Célula  2</td><td>Célula  3</td>

</tr><tr><td>Célula  4</td><td>Célula  5</td><td>Célula  6</td>

</tr></table>

Célula 1 Célula 2 Célula 3

Célula 4 Célula 5 Célula 6

Page 74: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<table><tr><td>Célula  1</td><td>Célula  2</td><td>Célula  3</td>

</tr><tr><td  colspan="3">Célula  4</td>

</tr></table>

Célula 1 Célula 2 Célula 3

Célula 4Célula 4Célula 4

Page 75: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<table><tr><td  rowspan="2">Célula  1</td><td>Célula  2</td><td>Célula  3</td>

</tr><tr><td>Célula  4</td><td>Célula  5</td>

</tr></table>

Célula 1

Célula 2 Célula 3

Célula 1

Célula 4 Célula 5

Page 76: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<form  action="script.php">        <ul>                <li>                        <label  for="name">Nome:</label>                        <input  type="text"  name="nome"  id="nome"  value="">                </li>                <li>                        <label  for="email">Email:</label>                        <input  type="text"  name="email"  id="email"  value="">                </li>                <li>                        <label  for="comments">Comentário:</label>                        <textarea  name="comentario"  id="comentario"  cols="25"  rows="3"></textarea>                </li>                <li>                        <input  type="submit"  value="Enviar">                </li>        </ul></form>

Page 77: HTML&CSS 1 - Introduction to HTML

HTMLCORPO

<div>      <span>

Page 78: HTML&CSS 1 - Introduction to HTML