Welcome to www.paezypaezrepresentaciones.com   Click to listen highlighted text! Welcome to www.paezypaezrepresentaciones.com Powered By GSpeech

Declaración DOCTYPE. para Frames

 Declaración DOCTYPE. para Frames

Cuando empleamos frames debemos utilizar una declaración distinta para el elemento DOCTYPE.

Luego la sección del DOCTYPE para una página que implementa frames debe ser:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">

Es decir se incorpora la palabra Frameset donde disponíamos la palabra Transitional o estaba vacía si validamos HTML estrícto.

Confeccionar una ventana que contenga dos frames verticales. Dispondremos dos hipervínculos en el frame de la izquierda que al ser presionados actualicen el archivo a mostrar por el frame de la derecha.

pagina1.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>prueba de frames</title>
</head>
<frameset cols="20%,80%">
<frame src="/pagina2.html">
<frame src="/pagina3.html" name="ventanadinamica">
<noframes>
<p>El navegador no soporta frames</p>
</noframes>
</frameset>
</html>

pagina2.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>prueba de frames</title>
</head>
<body>
<h2>Enlaces.</h2>
<ul>
<li><a href="/pagina3.html" target="ventanadinamica">Enlace
1</a></li>
<li><a href="/pagina4.html" target="ventanadinamica">Enlace
2</a></li>
</ul>
</body>
</html>

Es importante notar que hemos definido la página HTML Transitional, esto se debe a que la propiedad target del elemento "a" no está permitida. Es decir si utilizamos frames deberemos trabajar con HTML Transitional.

pagina3.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>prueba de frames</title>
</head>
<body>
<h1>Página B</h1>
<h2>Este es el contenido de página del archivo:pagina4.html</h2>
</body>
</html>

pagina4.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>prueba de frames</title>
</head>
<body>
<h1>Página B</h1>
<h2>Este es el contenido de página del archivo:pagina4.html</h2>
</body>
</html>
Don't have an account yet? Register Now!

Sign in to your account

Click to listen highlighted text! Powered By GSpeech