Noticias Weblogs Foros Wiki Código

RecorteX

» HTML
476 usuarios y 237 recortes de código
Usuario

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

RSS
Recortes: 25

Etiquetas relacionadas:
css
javascript
xhtml
xml
rss
php
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
texto
input
entidades
button
web
progreso
formularios

Poner un favicon en una página web

Incluir la siguiente línea en la sección <head> de la página
 
<link rel="shortcut icon" href="favicon.ico"/>
 

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 - Información legal y técnica