23.04.2014 Views

Importancia de respetar los estándares Luis Fernando Llana D´ıaz 3 ...

Importancia de respetar los estándares Luis Fernando Llana D´ıaz 3 ...

Importancia de respetar los estándares Luis Fernando Llana D´ıaz 3 ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

HTML<br />

<strong>Importancia</strong> <strong>de</strong> <strong>respetar</strong> <strong>los</strong> estándares<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

Departamento <strong>de</strong> Sistemas Informáticos y Computación<br />

Universidad Complutense <strong>de</strong> Madrid<br />

3 <strong>de</strong> mayo <strong>de</strong> 2010<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


HTML: HyperText Markup Language<br />

Hipertexto: Texto que enlaza referencias, permite la navegación.<br />

Lenguaje <strong>de</strong> marcado: texto plano con marcas especiales que<br />

indican el cometido <strong>de</strong> cada parte <strong>de</strong>l mismo.<br />

L A TEX: Leslie Lamport TEX(D.E. Knuth).<br />

HTML <strong>de</strong> Tim Berners-Lee.<br />

XML, XHTML.....<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


¿Cómo se genera el HTML?<br />

Manualmente,<br />

Con un editor <strong>de</strong> texto: emacs, kate, kwrite, gedit, . . . .<br />

Con un editor <strong>de</strong> HTML: quata, . . .<br />

Mediante un programa<br />

Programas PHP.<br />

Servlets, JSP.<br />

Gestor <strong>de</strong> contenidos: PLONE.<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Esctructura <strong>de</strong> un documento HTML<br />

<br />

<br />

<br />

<br />

Prueba 1 <br />

<br />

<br />

Prueba 1 <br />

Parrafo <br />

<br />

item 1 <br />

item 2 <br />

<br />

<br />

<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

9<br />

10<br />

11<br />

12<br />

13<br />

14<br />

15<br />

16<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


IMPORTANTE<br />

En HTML se representan <strong>los</strong> elementos, no cómo se pintan.<br />

HTML tiene la estrucutura no la presentación.<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Añadiendo estilo<br />

<br />

................<br />

<br />

.................<br />

<br />

1<br />

2<br />

3<br />

4<br />

5<br />

body {<br />

background - color : # ace ;<br />

color : black ;<br />

font - family :sans - serif ;<br />

padding :0;<br />

margin :0;<br />

}<br />

h1 ,h2 ,h3 ,h4 ,h5 ,h6 {<br />

font - variant : small - caps ;<br />

background - color :#99 FF33 ;<br />

padding - left :1 em;<br />

padding - right :1 em;<br />

bor<strong>de</strong>r - top : solid 1pt black ;<br />

bor<strong>de</strong>r - bottom : solid 1pt black ;<br />

text - align : right ;<br />

}<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

9<br />

10<br />

11<br />

12<br />

13<br />

14<br />

15<br />

16<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Marcas importantes<br />

Cabeceras: h1, . . . , h6.<br />

Párrafos: p.<br />

Listas: ol, ul, dl.<br />

Tablas: table.<br />

Enlaces: a.<br />

Imágenes: img.<br />

Formularios: form.<br />

Marcas <strong>de</strong> formato: span, div.<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Cabeceras<br />

Sirven para dar estructura al documento.<br />

Se <strong>de</strong>ben usar <strong>de</strong> forma or<strong>de</strong>nada:<br />

Uso a<strong>de</strong>cuado: NO se <strong>de</strong>be usar para cambiar el tipo <strong>de</strong> letra.<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


I Premio Complutense - Microsoft <strong>de</strong> Diseno Accesible <br />

Bases <br />

La Universidad Complutense <strong>de</strong> Madrid , a traves <strong>de</strong>l Observatorio<br />

Complutense <strong>de</strong> la Accesibilidad a la Educacion Superior , convoca ...<br />

..........................<br />

<br />

Candidatos <br />

Requisitos <br />

..........................<br />

Formularios <br />

........................<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

9<br />

10<br />

11<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Párrafos<br />

Todo el texto <strong>de</strong>be ir <strong>de</strong>ntro <strong>de</strong> un bloque<br />

El párrafo es la principal marca <strong>de</strong> bloque.<br />

Todo el texto <strong>de</strong>ben ir <strong>de</strong>ntro <strong>de</strong> una marca <strong>de</strong> bloque .<br />

La principal marca <strong>de</strong> bloque es el parrafo .<br />

<br />

<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Diaz <br />

Dept . Sistemas Informaticos y Programacion <br />

Facultad <strong>de</strong> Informatica <br />

Universidad Complutense <strong>de</strong> Madrid <br />

<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

9<br />

10<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Enlaces (Anchors)<br />

Los enlaces hacen que el HTML sea hyper.<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Diaz <br />

1<br />

<br />

<br />

<br />

1<br />

2<br />

3<br />

4<br />

5<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Tipos <strong>de</strong> URLs<br />

Absoluta:<br />

... 1<br />

Relativas:<br />

Al servidor don<strong>de</strong> está el documento:<br />

... <br />

... <br />

... <br />

1<br />

2<br />

3<br />

Al documento actual . . .<br />

... <br />

... <br />

... <br />

... <br />

1<br />

2<br />

3<br />

4<br />

. . . o marca base, <strong>de</strong>ntro <strong>de</strong> la cabecera:<br />

<br />

1<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Imágenes<br />


Tablas<br />

<br />

1<br />

<br />

<br />

3<br />

Nombre Apellidos Telefono e-Mail 4<br />

<br />

5<br />

<strong>Luis</strong> <strong>Fernando</strong> <br />

6<br />

<strong>Llana</strong> Diaz <br />

7<br />

4527 <br />

8<br />

llana@sip . ucm .es <br />

9<br />

<br />

10<br />

<br />

11<br />

<br />

12<br />

Jose <strong>Luis</strong> <br />

13<br />

14<br />

Rodriguez Zapatero <br />

15<br />

<br />

16<br />

zp@la - moncloa .es <br />

17<br />

<br />

18<br />

<br />

19<br />

<br />

20<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Atributos<br />

src, href, alt, action, method.<br />

Modifican el comportamiento <strong>de</strong> la marca.<br />

El valor siempre <strong>de</strong>be ir entre comillas simples ’ o comillas<br />

dobles ".<br />

Obsoleto: . Todo lo relativo a<br />

visualización: colores, tipos <strong>de</strong> letras, posicionamiento, se <strong>de</strong>be<br />

<strong>de</strong>jar en hojas <strong>de</strong> estilo separadas.<br />

<br />

1<br />

saltar menu <strong>de</strong> navegacion <br />

2<br />

Enlaces :<br />

3<br />

<br />

4<br />

Universidad Complutense <strong>de</strong> Madrid 5<br />

Pagina <strong>de</strong> <strong>Luis</strong> 6<br />

Pagina <strong>de</strong>l W3C <br />

7<br />

<br />

8<br />

<br />

9<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Uso bueno <strong>de</strong>l marcado I<br />

I<strong>de</strong>ntificación <strong>de</strong>l lenguaje natural:<br />

<br />

......<br />

<br />

.....<br />

..... <br />

.....<br />

<br />

<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

No usar las comillas:<br />

texto entre comillas <br />

1<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Uso bueno <strong>de</strong>l marcado II<br />

Citas:<br />

< blockquote cite =" http :// www . mycom . com / tolkien / twotowers . html "><br />

1<br />

They went in single file , running like hounds on a strong scent , 2<br />

and an eager light was in their eyes . Nearly due west the broad<br />

3<br />

swath of the marching Orcs tramped its ugly slot ; the sweet grass<br />

4<br />

of Rohan had been bruised and blackened as they passed . <br />

5<br />

<br />

6<br />

Usar a<strong>de</strong>cuadamente las cabeceras h1,. . . , h6. No usarlo para<br />

cambiar <strong>de</strong> tamaño <strong>de</strong> letra.<br />

<br />

span . aviso {<br />

font - size : xx - large ;<br />

color : red ;<br />

}<br />

<br />

.......<br />

.......<br />

.... <br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

9<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Uso bueno <strong>de</strong>l marcado III<br />

No usar tablas para maquetado <strong>de</strong> las páginas.<br />

<br />

1<br />

<br />

2<br />


Uso bueno <strong>de</strong>l marcado IV<br />

Texto en 2 columnas<br />

<br />

<br />

Un parrafo , .... <br />

Otro parrafo , ... <br />

<br />

<br />

Un parrafo , ... <br />

<br />

<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

9<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Leyendo el estándar I<br />

http://www.w3.org/TR/html401/<br />

Descripción sintáctica <strong>de</strong> un fichero HTML en sintaxis DTD.<br />

Don<strong>de</strong> se pue<strong>de</strong>n colocar marcas y don<strong>de</strong> no. E.j. una referencia<br />

<strong>de</strong>be estar <strong>de</strong>ntro <strong>de</strong> una marca <strong>de</strong> bloque.<br />

Dos clases <strong>de</strong> marcas block o inline.<br />

<br />

<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

<br />

1<br />

2<br />

3<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Leyendo el estándar II<br />

<br />

<br />

1<br />

2<br />

3<br />

4<br />

<br />

<br />

<br />

<br />

<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

9<br />

10<br />

11<br />

12<br />

<br />

1<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Leyendo el estándar III<br />

<br />

<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

9<br />

10<br />

11<br />

12<br />

13<br />

14<br />

15<br />

16<br />

17<br />

<br />

<br />

1<br />

2<br />

3<br />

4<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Formularios I<br />

Interactuar con el servidor:<br />

<br />

<br />

<br />

<br />

Buscar <br />

<br />

< button type =" submit ">Buscar en google <br />

<br />

<br />

<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

9<br />

10<br />

AVISO: la etiqueta no funciona bien en IE. El siguiente<br />

NO funciona bien en IE:<br />

< button type =" submit " name =" borrar " value ="3">Borrar <br />

< button type =" submit " name =" modificar " value ="3">Modificar <br />

1<br />

2<br />

En IE6/IE8 es necesario usar la etiqueta<br />

.<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Formularios II<br />

Atributos:<br />

action URL <strong>de</strong>l programa que analiza la petición; pue<strong>de</strong> se<br />

un PHP, JSP o servlet <strong>de</strong> Java, ASP, Phyton, CGI<br />

(prgrama en cualquier lenguaje <strong>de</strong> programación:<br />

Python, Perl, C o incluso Pascal).<br />

Salida <strong>de</strong>l programa un fichero HTML.<br />

method dos métodos <strong>de</strong> dar el input al programa.<br />

get se aña<strong>de</strong>n <strong>los</strong> parámetros a la URL.<br />

post se aña<strong>de</strong>n el la petición como fichero <strong>de</strong><br />

entrada (no aparece en la URL).<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Formularios III<br />

Todas las marcas <strong>de</strong> entrada <strong>de</strong>ben tener el atributo name (para el<br />

servidor) y el atributo id (para la marca label).<br />

Marca input, atributo type:<br />

text Texto normal.<br />

password Texto normal, pero en el echo aparecen *. AVISO no<br />

es seguro.<br />

checkbox Marcado o no, verda<strong>de</strong>ro o falso, etc...<br />

radio Opciones alternativas, sólo se pue<strong>de</strong> seleccionar uno<br />

<strong>de</strong> <strong>los</strong> relacionados (tienen el mismo atributo name).<br />

image, reset, submit, button botones, es preferible usar la<br />

etiqueta button, pero cuidado con IE.<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid


Formularios IV<br />

Otras marcas <strong>de</strong> input:<br />

file mandar un fichero, es necesario que el método sea<br />

post.<br />

hid<strong>de</strong>n datos que no se muestran en el navegador.<br />

Otras marcas <strong>de</strong> entrada (no input):<br />

textarea textos largos.<br />

...... para listas<br />

<strong>de</strong>splegables.<br />

http://antares.sip.ucm.es/~luis/sugerencias.php<br />

<strong>Luis</strong> <strong>Fernando</strong> <strong>Llana</strong> Díaz<br />

HTML<br />

Departamento <strong>de</strong> Sistemas Informáticos y ComputaciónUniversidad Complutense <strong>de</strong> Madrid

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!