Documentos de Académico
Documentos de Profesional
Documentos de Cultura
PRACTICA DE HTML
ETIQUETAS BASICAS
ESCRIBIR UN PARRAFO
Ejemplo 1:
<html>
<head>
</head>
<body>
<p>
SQL, Structure Query Language (Lenguaje de Consulta Estructurado) es un lenguaje de
programacion para trabajar con base de datos relacionales como MySQL, Oracle, etc.<br>
MySQL es un interpretador de SQL, es un servidor de base de datos.<br>
MySQL permite crear base de datos y tablas, insertar datos, modificarlos, eliminarlos, ordenarlos,
hacer consultas y realizar muchas operaciones, etc., resumiendo: administrar bases de datos.
</p>
<p>
Este tutorial tiene por objetivo acercar los conceptos iniciales para introducirse en el mundo de las
bases de datos.
</p>
</body>
</html>
Ejemplo 2:
<html>
<head>
<title>Parrafo</title>
</head>
<body>
<center><h3>Bienvenido a mi pagina personal</h3></center>
<p align="left"> Ahora estoy escribiendo el primer párrafo de mi página personal, que quiero que
se alinea a la izquierda. </p>
<p align="right"> Pero esta línea quiero que salga a la derecha</p>
<p align="center"> Y ahora en el centro</p>
</body>
</html>
-1-
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
SALTO DE LINEA
<html>
<head>
</head>
<body>
PHP<br>
JavaScript<br>
Java<br>
C<br>
C++
</body>
</html>
Ejemplo 2:
<html>
<head>
<title>
Deportistas Latinos
</title>
</head>
<body>
<p>
En Latinoamérica existen muchos personajes que día a día se destacan en su labor dejando bien en
alto ante el resto del mundo el nombre de nuestros países.
-2-
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
<br>
Vamos aqui a presentar unicamente a deportistas que con su labor, tanto dentro como fuera de la
cancha, nos hacen sentir orgullosos a todos los latinos:
<br> Beisbol:
<br>
Andres Galarraga
<br>
Samuel Sosa
<br>
Omar Vizquel
<br>
Ivan Rodriguez
<br>
Vinicio Castilla
<br>
Edgardo Alfonso
<hr size="5">
Futbolistas:
<br>
Roberto Carlos
<br> Marco a. Etcheverry
<br>
Carlos Valderrama
<br>
Jose L. Chilavert
<br>
Gabriel Batistuta
<br>
<hr color="blue" size="10" >
</body>
</html>
Ejemplo 3:
<html>
<head>
<title>Ejemplo</title>
</head>
<body>
<hr>
<br>
<hr size=10>
<br>
<hr width=50>
<br>
<hr width=50%>
<br>
<hr align=left width=50%>
<br>
<hr align=right width=50%>
</body>
</html>
-3-
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
Ejemplo 4:
<html>
<head>
<title>Ejemplo</title>
</head>
<body>
<p align="center">ejemplo
<hr width=50% align=center</p>
<br><br>
<p align="left">Se ven las diferentes características de las
líneas separadoras horizontales:</p>
<br>
<p align="left">Anchura del 50% y justificación a la izquierda
<hr width=50% align=left></p>
<br>
<p align="center">Anchura del 70%, justificación al centro y
grosor de 5 píxels
<hr width=70% align=center size=5></p>
<br>
<p align="center">Anchura de 200 píxels, justificación al
centro, grosor de 10 píxels, relleno sólido
<hr width=200 align=center size=10 noshade></p>
<br>
<p align="right">Anchura de 200 píxels, justificación a la
derecha, grosor de 20 píxels
<hr width=300 align=right size=20></p>
</body>
</html>
Ejemplo 5:
<html>
<head>
<title>Ejemplo</title>
</head>
<body>
<hr noshade>
<hr width=250 size=3>
<hr width=250 size=6>
<hr noshade width=400 size=4>
</body>
</html>
Ejemplo 6:
<html>
<head>
<title>Ejemplo</title>
</head>
<body>
<hr color="#0000ff" width="300" align="left" size="30" >
<hr color="#00ff00" width="300" align="center" noshade>
</body>
</html>
-4-
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
FORMATOS DE TEXTO
TEXTO EN NEGRITA
<html>
<head>
<title>Texto en Negrita</title>
</head>
<body>
Texto normal -
<b>Texto en negrita</b>
</body>
</html>
TEXTO EN ITALICA
<html>
<head>
<title>Texto en Itálica</title>
</head>
<body>
Texto normal -
<i>Texto en itálica</i>
</body>
</html>
TEXTO SUBRAYADO
<html>
<head>
<title>Texto Subrayado</title>
</head>
<body>
Texto normal -
<u>Texto subrayado</u>
</body>
</html>
TEXTO TELETIPO
<html>
<head>
<title>Texto en Teletipo</title>
</head>
<body>
Texto normal -
<tt>Texto en teletipo</tt>
</body>
</html>
-5-
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
Texto normal -
<sub>Texto por debajo</sub>
</body>
</html>
TEXTO TACHADO
<html>
<head>
<title>Texto Tachado</title>
</head>
<body>
Texto normal -
<strike>Texto tachado</strike>
</body>
</html>
ADDRESS
<html>
<head>
<title>Etiqueta Address</title>
</head>
<body>
-6-
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
<address>
DistritoWeb. Todos los derechos reservados. info@DistritoWeb.net
</address>
</body>
</html>
BLOCKQUOTE
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<p>Ejemplo:</p>
<blockquote>
<blockquote>
<p>es una etiqueta que se utiliza para encerrar un texto parafraseado, una cita, un ejemplo, etc. y
conseguir con ella un efecto de sangrado de texto. Tanto el margen izquierdo, como el derecho, se
amplían automáticamente.
</p>
</blockquote>
</blockquote>
</body>
</html>
CITE
<html>
<head>
<title>Etiqueta Cite</title>
</head>
<body>
La <cite> especificación del HTML 4.01 </cite> dice: <blockquote> Nota. Recomendamos
que las implementaciones de hojas de estilo porporcionen un mecanismo para insertar
signos de puntuación de citas antes y después de una cita delimitada por un BLOCKQUOTE
de un modo apropiado según el contexto del idioma actual y el grado de anidamiento de
las citas. </blockquote>
</body>
</html>
PRE
Ejemplo1:
<html>
<head><title>Ejemplo de etiqueta pre</title></head>
<body>
<pre>
La etiqueta pre
respeta los espacios en blanco
y
muestra el texto
tal y como
está escrito
</pre>
<p>
-7-
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
La etiqueta pre
respeta los espacios en blanco
y
muestra el texto
tal y como
está escrito
</p>
</body>
</html>
Ejemplo2:
<html>
<head>
<title>Espacios en blanco arbitrarios</title>
</head>
<body>
<h2>Características de los planetas</h2>
<pre>
Nombre Diametro relativo Período orbital Número de lunas
--------------------------------------------------------------------------------------
Mercurio 0,382 0,24 años 0
Venus 0,949 0,62 años 0
Tierra 1 1 año 1
Marte 0,532 1,88 años 2
Júpiter 11,209 11,86 años 49
Saturno 9,449 29,46 años 52
Urano 4,007 84,01 años 27
Neptuno 3,883 164,80 años 13
</pre>
</body>
</html>
NOBR
<html>
<head>
<title>Ejemplo de </title>
</head>
<body>
<nobr>HTML (HyperText Markup Language) es un lenguaje de programación que se utiliza para la
creación de páginas en la WWW. Por página entenderemos el documento que aparece en el
visualizador. Para hacer una pagina web solo se necesita un editor de texto desde el block de notas
hasta programas hechos exclusivamente para editar paginas web(Frontpage, Visual
Interdev,Dreamweaver, etc). </nobr>
</body>
</html>
DIV
<html>
<head>
<title>Texto Tachado</title>
</head>
<body>
-8-
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
CARACTERES ESPECIALES
&NBSP
<html>
<head>
<title>Ejemplo de </title>
</head>
<body>
<p>Este primer párrafo no contiene saltos de línea ni otro tipo de espaciado.</p>
<p>Este segundo párrafo sí que contiene saltos <br/>
de <br/>
línea <br/>
y otro tipo de espaciado.</p>
</body>
</html>
Ejemplo 2:
<html>
<head>
<title> Página de ejemplo </title>
</head>
<body>
Este es el contenido del documento. Puedo escribir lo que
desea, en <b>negrita</b>, <em>cursiva</em>, o
<big>letra más grande</big>.
-9-
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
ACRONYM
<html>
<head>
<title>Ejemplo de Acronimo
</title>
</head>
<body>
La <acronym title="World Wide Web" lang="en">WWW es un sistema de documentos de
hipertexto y/o hipermedios enlazados y accesibles a través de Internet. Con un navegador Web, un
usuario visualiza páginas web que pueden contener texto, imágenes, vídeos u otros contenidos
multimedia, y navega a través de ellas usando hiperenlaces</acronym>
</body>
</html>
- 10 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
FORMATO DE TEXTO
ETIQUETA BASEFONT
Ejemplo:
<html>
<head>
<title>Ejemplo de basefont</title>
<head>
<body>
El texto por defecto tiene tamaño 3.
<basefont size=5>
A partir de ahora tendrá tamaño 5.
<body>
</html>
Ejemplo:
<html>
<head>
<title>Ejemplo de basefont</title>
</head>
<body>
<basefont size=7>
<p>A esta página le hemos puesto como <em>fuente base</em> un tamaño 7.</p>
<p>Si usamos <small> el texto queda más pequeño, disminuye en relación al tamaño base:
<small>más pequeño</small>.</p>
</body>
</html>
ETIQUETA FONT
Ejemplo:
<html>
<head>
<title>Ejemplo de font</title>
</head>
<body>
<font size=1> fuente de tamaño 1</font><br>
<font size=2> fuente de tamaño 2</font><br>
<font size=3> fuente de tamaño 3</font><br>
<font size=4> fuente de tamaño 4</font><br>
<font size=5> fuente de tamaño 5</font><br>
<font size=6> fuente de tamaño 6</font><br>
<font size=7> fuente de tamaño 7</font><br>
</body>
</html>
Ejemplo:
<html>
<head>
<title>Ejemplo de font</title>
</head>
<body>
texto de tamaño 3
- 11 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
<font size="+3">
texto de tamaño 6
</font>
</body>
</html>
Ejemplo:
<html>
<head>
<title>ejemplo de font</title>
</head>
<body>
texto normal (tamaño 3)
<font size="+1">
texto de tamaño 4
</font>
<font size="+1">
este texto sigue teniendo tamaño 4
</font>
</body>
</html>
Ejemplo:
<html>
<head>
<title>ejemplo de font y basefont</title>
</head>
<body>
<basefont size="3">
esto es texto de tamaño 3,
<font size="+3">
esto es de tamaño 6,
</font>
<font size="+4">
y esto es de tamaño 7
</font>
</body>
</html>
Ejemplo:
<html>
<head>
<title>ejemplo de font y basefont</title>
</head>
<body>
<basefont size="4">
esto es texto de tamaño 4,
<font size="+3">
esto es de tamaño 7,
</font>
<font size="+4"
y esto sigue siendo de tamaño 7
- 12 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
</font>
</body>
</html>
Ejemplo:
<html>
<head>
<title>ejemplo de color</title>
</head>
<body>
<h1>
<font color="fuchsia">
colores en el web
</font>
</h1>
ya podemos decir que sabemos poner colores en las páginas web,
<font color="green">
verde
</font>,
<font color="blue">
azul
</font>
<font color="red">
rojo
</font>,
etc. ninguno se nos resiste.
</body>
</html>
TIPO DE FUENTE
Ejemplo:
<html>
<head>
<title>ejemplo de tipos de fuentes</title>
</head>
<body>
Fuente por defecto
<font face="arial">Fuente Arial</font>
<font face="times">Fuente Times</font>
- 13 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
Ejemplo:
<html>
<head>
<title>Ejemplo</title>
</head>
<body>
<font face="arial" size="2" color="#0088AA">
Estudio estadounidense concluye que para el cerebro es saludable navegar por Internet. La red
puede ser especialmente provechosa para las personas mayores, al ayudarles a mantener una
actividad adecuada en sus neuronas.
</font>
</body>
</html>
Ejemplo:
<html>
<head>
<title>colores</title>
</head>
<body>
<font color=orange size=7>
colores<br>
</font>
<font color="#33ff00" size=+2>
ejemplo 1<br>
</font>
<font color="#ff00ff">
ejemplo 2<br>
</font>
</body>
</html>
Ejemplo:
<html>
<head>
<title>fuentes</title>
</head>
<body>
<font color=red size=7 face="comic sans ms,arial">
ejercicio 5<br>
</font>
<font color="#33ccaa" size=5>
atributos<br>
</font>
<font color="#bb22ff" size=+3 face="courier new">
html<br>
</font>
- 14 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
</body>
</html>
Ejemplo:
<html>
<head>
<title>estilo de letras</title>
</head>
<body>
<center>
<h2>práctica tamaño, color y tipo de letras</h2>
<hr width=250><br>
</center>
<h1><font color="#ffff00">práctica de tamaño, color y tipo de
letras. color amarillo</font></h1>
<p align="center"><font size=5>texto en tamaño 5</font><br>
<font size=-1>texto algo menor</font><br>
<font size=+2>texto aún mayor</font><br><br>
<hr width=500><br></p>
<font color="#ff0000"><b>este texto es de color rojo y en
negrita</b></font><br>
<font color="0000ff"><u>este texto es de color azul y
subrayado</u></font><br><br>
<font face="verdana" color="00ff00" size=6>este texto se verá
con la fuente verdana, color verde y tamaño 6</font>
</body>
</html>
Ejemplo:
<html>
<head>
<title>ejemplo</title>
</head>
<body>
<b><font color="red">texto rojo </font>
<br>
<font color="blue">texto azul </font>
<br>
<font color="navy">texto azul marino </font>
<br>
<font color="green">texto verde </font>
<br>
<font color="olive">texto oliva </font>
<br>
<font color="yellow">texto amarillo </font>
<br>
<font color="lime">texto lima </font>
<br>
<font color="magenta">texto magenta </font>
<br>
<font color="purple">texto purpura </font>
<br>
- 15 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
- 16 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
VINCULOS
MARCAPAGINAS DE UN DOCUMENTO
Ejemplo:
<html>
<head>
<title>Marcapáginas en el documento</title>
</head>
<body>
<a href="#sec5">Ir a la sección 5</a>
<h3>Sección 1</h3>
<p>Texto, texto y más texto.</p>
<h3>Sección 2</h3>
<p>Texto, texto y más texto.</p>
<h3>Sección 3</h3>
<p>Texto, texto y más texto.</p>
<h3>Sección 4</h3>
<p>Texto, texto y más texto.</p>
<h3><a name="#sec5">Sección 5</a></h3>
<p>Texto, texto y más texto.</p>
<h3>Sección 6</h3>
<p>Texto, texto y más texto.</p>
<h3>Sección 7</h3>
<p>Texto, texto y más texto.</p>
<h3>Sección 8</h3>
<p>Texto, texto y más texto.</p>
</body>
</html>
Ejemplo:
Archivo: ej3.htm
<html>
<head>
<title>ejemplo 3</title>
</head>
<body>
<a name="arriba"><h1>página de enlaces</h1></a>
<a href="#abajo">ir abajo</a><br>
<a href="ej4.htm">ir a ejemplo 4</a><br><br>
<a href="http://www.google.com.pe/">ir a google</a><br>
- 17 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br><br>
<br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br>.<br>.<br>.<br>.<br>.<br>
<a name="abajo"><br></a>
<a href="#arriba">ir arriba</a>
</body>
</html>
Ejemplo:
Archivo: ej4.htm
<html>
<head>
<title>ejemplo 4</title>
</head>
<body>
<h1>página de enlaces</h1>
<a href="ej3.html"> volver a ejemplo 3</a>
</body>
</html>
Ejemplo:
<html>
<head>
<title>ejemplo 5</title>
</head>
<body>
<h1>diferentes tipos de urls</h1>
enlace a <a href="http://www.google.com.pe">google</a>.
<br>
enlace al servidor de ftp
de <a href="ftp://ftp.mozilla.org/pub/mozilla/">mozilla</a>.
<br>
enlace a <a href="mailto:maikejauregui66@hotmail.com">
direccion de correo del profesor</a>.
<br>
enlace a las <a href="news://msnews.microsoft.com">news de microsoft</a>.
<br>
</body>
</html>
Ejemplo:
<html>
<head>
<title>
Ejemplo de Bookmark
</title>
</head>
<body>
<p>Un ejemplo de bookmark es mostrado a continuacion:</p>
<p><a href="#Desarrollando Webs 1">Desarrollando Webs 1</a></p>
<p><a href="#Desarrollando Webs 2">Desarrollando Webs 2</a></p>
- 18 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
- 19 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
<p> </p>
<p> </p>
<p> </p>
</body>
</html>
- 20 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
IMÁGENES
COLOCAR UNA IMAGEN EN EL DOCUMENTO
<html>
<head>
<title><img src=...alt=...></title>
</head>
<body>
<img src="http://www.virtualnauta.com/graficos/foto1.jpg" alt="Dos niñas caminando de la
mano">
</body>
</html>
ALINEACION DE IMAGENES
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<p>
Esto es un parrafo con una imagen
<img src="Imagenes/ranita.gif" align="left" width="55" height="55" alt=""> a la izquierda del
texto( la imagen flotará a la izquierda del parrafo).
</p>
<p>
<img src="Imagenes/ranita.gif" align="right" width="55" height="55" alt=""> Esto es un parrafo
con una imagen a la derecha (la imagen flotará a la derecha del parrafo).
</p>
<p>
<img src="Imagenes/ranita.gif" width="55" height="55" alt=""> Una imagen antes del texto
</p>
<p>
una imagen despues del texto <img src="Imagenes/ranita.gif" align="top" width="55" height="55"
alt=""></p>
<p>
esto es una imagen incluida <img src="Imagenes/ranita.gif" align="middle" width="55"
height="55" alt=""> en el texto
</p>
</body>
</html>
- 21 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
BORDES Y MARGENES
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<table border="1">
<tr>
<td>
<img src="Imagenes/rana.gif" border="2" width="79" height="78" alt="rana">
</td>
</tr>
</table>
<p><br></p>
<table border="1">
<tr>
<td>
<img src="Imagenes/rana.gif" border="2" hspace="40" vspace="60" width="79" height="78"
alt="rana">
</td>
</tr>
</table>
</body>
</html>
TAMAÑO
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<p>Variando los valores de los atributos
<b>width</b> y <b>height</b> se puede
ampliar o reducir una imagen.</p>
<p><br></p>
<p>Esto es una imagen normal:
<img src="Imagenes/rana.gif" width="79" height="78" alt="">
</p>
<p><br></p>
- 22 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
MAPA DE IMÁGENES
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<map name="MAPA">
<area shape="rect" coords="0,0,50,50" href="verde.htm">
<area shape="circle" coords="78,75,25" href="violeta.htm">
<area shape="rect" coords="0,80,40,99" href="rojo.htm">
</map>
Ejemplo de una mapa interactivo. Pica en el cuadro para acceder a las paginas verde, violeta y rojo
<br>
<center><a><img src="Imagenes/cuadro.gif" usemap="#Mapa"></a></center>
</body>
</html>
Rojo
<html>
<head>
<title>Untitled Document</title>
</head>
<body bgcolor="FF0000">
<center>ROJO</center>
- 23 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
</body>
</html>
Verde
<html>
<head>
<title>Untitled Document</title>
</head>
<body bgcolor="#00FF00">
<center>VERDE</center>
</body>
</html>
Violeta
<html>
<head>
<title>Untitled Document</title>
</head>
<body bgcolor="ff00ff">
<center>VIOLETA</center>
</body>
</html>
Cuadrado.htm
Escribir un texto de color azul
Circulo.htm
Escribir un texto de color rojo
Triangulo.htm
Escribir un texto de color verde
- 24 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
TABLAS
- 25 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
</TR>
<TR>
<TD>A</TD> <TD>B</TD> <TD>C</TD>
</TR>
<TR>
<TD>D</TD> <TD>E</TD> <TD>F</TD>
</TR>
</TABLE>
- 26 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
- 27 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
CELLPADDING y CELLSPACING
<TABLE BORDER>
<TR>
<TH>Enero</TH>
<TH>Febrero</TH>
<TH>Marzo</TH>
</TR>
<TR>
<TD>Esta es la celda 1</TD>
<TD>Celda 2</TD>
<TD>Otra celda,<br> celda 3</TD>
- 28 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
</TR>
<TR>
<TD>Celda 4</TD>
<TD>y ahora esta<br>es celda 5</TD>
<TD>Celda 6</TD>
</TR>
</TABLE>
Como la tabla y las celdas carecen de ancho (width) el navegador determina éste según la longitud
del texto en cada celda.
ALIGN=LEFT|RIGHT|CENTER
Nota: este formato se puede aplicar a celdas individuales o a todas las filas.
VALIGN=TOP|BOTTOM|MIDDLE
Nota: este formato se puede aplicar a celdas individuales o a todas las filas.
- 29 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
<TD>Celda 3</TD>
</TR>
<TR HEIGHT=50>
<TD VALIGN=top>Alineado arriba</TD>
<TD VALIGN=bottom>Alineado abajo</TD>
<TD>Por defecto,<br>centro</TD>
</TR>
</TABLE>
CAPTION=TOP|BOTTOM [TÍTULO]
<TABLE BORDER>
<CAPTION ALIGN=bottom><B>CAPTION [TÍTULO] abajo</B></CAPTION>
<TR>
<TH>January</TH>
<TH>February</TH>
<TH>March</TH>
</TR>
<TR>
<TD>This is cell 1</TD>
<TD>Cell 2</TD>
<TD>Another cell,<br> cell 3</TD>
</TR>
</TABLE>
- 30 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
<CENTER>
<TABLE BORDER WIDTH="50%">
<TR>
<TD>A</TD> <TD>B</TD> <TD>C</TD>
</TR>
<TR>
<TD>D</TD> <TD>E</TD> <TD>F</TD>
</TR>
</TABLE>
</CENTER>
- 31 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
ALTURA (HEIGHT)
TABLA
<html>
<head>
<title>título</title>
</head>
<body>
<table border=0>
<td>
<table border=1 align=left>
<caption>Tabla básica</caption>
<tr> <td>1,1</td> <td>1,2</td> <td>1,3</td> </tr>
<tr> <td>2,1</td> <td>2,2</td> <td>2,3</td> </tr>
<tr> <td>3,1</td> <td>3,2</td> <td>3,3</td> </tr>
</table>
</td>
- 32 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
<td>
<table border=1 align=left>
<caption>Tabla hueca</caption>
<tr> <td>1,1</td> <td>1,2</td> <td>1,3</td> </tr>
<tr> <td>2,1</td> <td> </td> <td>2,3</td> </tr>
<tr> <td>3,1</td> <td>3,2</td> <td>3,3</td> </tr>
</table>
</td>
<td>
<table border=1 align=left>
<caption>Tabla con colspan</caption>
<tr> <td colspan=3 align=center>1,x</td> </tr>
<tr> <td>2,1</td> <td>2,2</td> <td>2,3</td> </tr>
<tr> <td>3,1</td> <td>3,2</td> <td>3,3</td> </tr>
</table>
</td>
<td>
<table border=1>
<caption>Tabla con rowspan</caption>
<tr> <td rowspan=3>x,1</td> <td>1,2</td> <td>1,3</td> </tr>
<tr> <td>2,2</td> <td>2,3</td> </tr>
<tr> <td>3,2</td> <td>3,3</td> </tr>
</table>
</td>
</table>
</body>
</html>
- 33 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
MARCOS (Frames)
Marcos en Vertical
Marco.htm
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<frameset cols="30%,40%,30%">
<frame src="ejframe1.htm">
<frame src="ejframe2.htm">
<frame src="ejframe3.htm">
</frameset><noframes></noframes>
<noframes></noframes>
</html>
Ejframe1.htm
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Primer Frame</title>
</head>
<STYLE type=text/css>BODY {
BACKGROUND-COLOR: blue
}
</STYLE>
<body>
<H3>Frame 1</H3>
</body>
</html>
Ejframe2.htm
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<STYLE type=text/css>BODY {
BACKGROUND-COLOR: yellow
}
</STYLE>
<body>
<H3>Frame 2</H3>
</body>
</html>
Ejframe3.htm
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- 34 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
<title>Untitled Document</title>
</head>
<STYLE type=text/css>BODY {
BACKGROUND-COLOR: red
}
</STYLE>
<body>
<H3>Frame 3</H3>
</body>
</html>
Marcos en horizontal
<html>
<frameset rows="30%,40%,30%">
<frame src="ejframe1.html">
<frame src="ejframe2.html">
<frame src="ejframe3.html">
</frameset>
</html>
- 35 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
- 36 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
Formularios
Campo de Texto
<html>
<head>
<title>campo de texto </title>
</head>
<body>
<p>Nombre:
<input type="text" name="nombre">
<br>Apellidos:
<input type="text" size="35"
name="apellidos"></p>
</body>
</html>
Opciones Simples
<html>
<head>
<title>opciones simples </title>
</head>
<body>
<p>Tienes television:
<input type="checkbox" name="ele" value="television"
checked="checked">
<br>
Tienes video:
<input type="checkbox" name="ele" value="video">
<br>
Tienes DVD:
<input type="checkbox" name="ele" value="DVD"></p>
</body>
</html>
Opciones Excluyentes
<html>
<head>
<title>opciones excluyentes</title>
</head>
<body>
<p>Hombre:
<input type="radio" name="sexo" value="masc">
<br>
Mujer:
<input type="radio" name="sexo" value="fem"
checked="checked"></p>
</body>
</html>
Lista de Opciones
<html>
<head>
<title>lista de opciones </title>
- 37 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
</head>
<body>
<p>Selecciona tu color preferido:<br>
<select name="color">
<option value="amarillo">Amarillo</option>
<option value="azul">Azul</option>
<option value="rojo">Rojo</option>
<option value="verde">Verde</option>
<option value="otro" selected="selected">
Otro</option>
</select>
<br><br>
Selecciona tus frutas predilectas:<br>
<select name="frutas" size="7" multiple="multiple">
<option value="melon">Melón</option>
<option value="piña">Piña</option>
<option value="uvas">Uvas</option>
<option value="pera">Pera</option>
<option value="manzana">Manzana</option>
<option value="naranja">Naranja</option>
<option value="platano">Platano</option>
</select></p>
</body>
</html>
Area de Texto
<html>
<head>
<title>area de texto</title>
</head>
<body>
<p>
<textarea rows="10" cols="30" name="texto">
Aquí puedes escribir el texto que quieras.
El elemento <textarea> sólo puede
contener texto.
</textarea>
</p>
<p><br>Los atributos <b>rows</b> y <b>cols</b>
del elemento <b><textarea></b> son
obligatorios.</p>
</body>
</html>
Botones de acción
<html>
<head>
<title>botones de accion</title>
</head>
<body>
<p>Un botón
<input type="button" value="Inicial">
- 38 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
</p>
</body>
</html>
Agrupación de campos
<html>
<head>
<title>agrupacion de campos </title>
</head>
<body>
<fieldset>
<legend>Ficha de compra</legend>
<label>Nombre</label>
<input type="text" name="nombre">
<br>
<label>Apellidos</label>
<input type="text" size="35"
name="apellidos">
<br><br>
<label>Television</label>
<input type="checkbox" name="TV">
<label>Vídeo</label>
<input type="checkbox" name="video">
<label>DVD</label>
<input type="checkbox" name="DVD">
</fieldset>
</body>
</html>
Texto oculto
<html>
<head>
<title> texto oculto</title>
</head>
<body>
- 39 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
<p>
Contraseña:
<input type="password" name="passw">
</p>
</body>
</html>
Cargar archivo
<html>
<head>
<title>cargar archivo </title>
</head>
<body>
<p>
<label>Archivo</label>
<input type="file" name="fname">
</p>
</body>
</html>
- 40 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
function obtener_nombre ()
{
if (!(nombre = consultar_cookie (cookie_nombre)))
{
nombre = window.prompt ('Escribe tu nombre por favor', '');
}
else
{
if (nombre == 'Desconocido')
{
nombre = window.prompt ('Escribe tu nombre por favor', '');
- 41 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
}
if (nombre == null || nombre == '')
{
nombre = 'Desconocido'
}
enviar_cookie (cookie_nombre, nombre, fin_de_cookie);
}
function contador ()
{
if (!(numero = consultar_cookie (cookie_contador)))
{
numero = 0;
numero++;
}
else
{
numero++;
}
enviar_cookie (cookie_contador, numero, fin_de_cookie);
}
function cookies ()
{
obtener_nombre ()
contador ()
</body>
</html>
- 42 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="JavaScript">
<!-- Ocultar código navegadores antiguos
<!-- Definición de la función del ejemplo 2
function conectar(form)
{
var direcciones=form.ir_a.selectedIndex
location=form.ir_a.options[direcciones].value;
}
function acceder(form)
{
location.href = form.enlaces.options[enlaceseleccionado()].value;
}
function enlaceseleccionado()
{
return document.navegador.enlaces.selectedIndex
}
function ir_abis(form)
{
form.enlace_usuario.value = form.enlaces.options[enlaceseleccionado()].value;
}
<body>
<center><h3>EJEMPLOS DE FORMULARIOS CON JAVASCRIPT</h3></center><br>
<!-- Comienzo del ejemplo 1 -->
<center>
<h5><font color="olive">Ejemplo número 1</font></h5>
<h3><font color="Blue">Seleccione el midi file que desea escuchar y pulse
Reproducir</font></h3>
<form>
<select name="Midis" size="4">
<option value="Barbara Streisand - Woman In Love.mp3">Midi File 1</option>
<option value="bangles-IF SHE KNEW WHAT SHE WANTS.mp3">Midi File 2</option>
<option value="Bangles - Manic Monday.mp3">Midi File 3</option>
<option value="bangles-WALKING DOWN YOUR STREET.mp3">Midi File 4</option>
</select>
<input type="button" value="Reproducir"
onclick="location.href=this.form.Midis.options[this.form.Midis.selectedIndex].value;">
- 43 -
INSTITUTO CIMAS PROFESOR: MAIKE JAUREGUI
</form>
</center>
- 44 -