Noticias Weblogs Foros Wiki Código

RecorteX

» html
326 usuarios y 203 recortes de código
Usuario

Contraseña
Crear cuenta
Estás viendo los recortes de la etiqueta html

RSS
Recortes: 24

Etiquetas relacionadas:
css
javascript
xhtml
xml
rss
php
texto
input
entidades
button
web
progreso
formularios
dieresis
tildes
favicon
checkbox
provincias
forumularios
diseño
acentos
vacio
letras
feeds
convertir
radio
imagen
div
atom
validar
países
form
correo
youtube
imprimir
electronico
barra
w3c
forma

Página con redirección automática en HTML

 
<html>
<head>
  <title>Título</title>
  <meta http-equiv="Refresh" content="0; URL=http://www.example.com">
</head>
<body>
  <a href="http://www.example.com">Ejemplo</a>
</body>
</html>
 

Plantilla XHTML 1.0

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
    <head>	
        <title>Título</title>
        <link rel="stylesheet" type="text/css" href="estilos.css" />
    </head>
    <body>
        <!-- contenido -->
    </body>
</html>
 

Truco para ajustar el CSS

Si ponemos al principio de nuestra hoja de estilo las siguientes líneas, podremos visualizar la estructura de nuestro sitio fácilmente.

 
  * { outline: 2px dotted red }
  * * { outline: 2px dotted green }
  * * * { outline: 2px dotted orange }
  * * * * { outline: 2px dotted blue }
  * * * * * { outline: 1px solid red }
  * * * * * * { outline: 1px solid green }
  * * * * * * * { outline: 1px solid orange }
  * * * * * * * * { outline: 1px solid blue }
 

Tomado de este sitio

Mostrar u ocultar un DIV

Lo siguiente muestra un link "Ver más" que abre un div oculto:
 
<script>
// definiciones basicas
OCULTO="none";
VISIBLE="block";
	
function mostrar(blo) {
  document.getElementById(blo).style.display=VISIBLE;
  document.getElementById('ver_off').style.display=VISIBLE;
  document.getElementById('ver_on').style.display=OCULTO;
}
 
function ocultar(blo) {
  document.getElementById(blo).style.display=OCULTO;
  document.getElementById('ver_off').style.display=OCULTO;
  document.getElementById('ver_on').style.display=VISIBLE;
}
</script>
 
Y el código HTML que lo utiliza:
 
<div id="ver_on"><a href="#" onclick="mostrar('bloque')">Ver más</a></div>
<div id="ver_off" style="display: none"><a href="#" onclick="ocultar('bloque')">Ver menos</a></div>
<div id="bloque" style="display: none">Texto a mostrar u ocultar</div>
 
info@recortex.com - Proyecto: Juanjo Navarro, 2006 - Diseño: Albin