Ver Mensaje Individual
  #3 (permalink)  
Antiguo 26/03/2004, 18:05
Avatar de PatomaS
PatomaS
Colaborador
 
Fecha de Ingreso: marzo-2004
Ubicación: En alguna otra parte
Mensajes: 4.656
Antigüedad: 20 años, 1 mes
Puntos: 63
position: fixed (todos los navegadores)

Hola gente, aquí pego el código que creo sirve para que una sección hecha con un div, quede fija en la pantalla.

He probado con estas versiones de navegadores:

- Firefox 0.8
- Firebird 0.7
- Netscape 7.0
- Explorer 6.0
- Opera 7.23

Agradecería que si alguien lo prueba con otro navegador diferente, mande sus resultados aquí, es decir, si funciona o no funciona.

__________________________

Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html  lang="en">
<head>
<title>Prueba de fixed</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
body {
	margin: 0;
	padding: 0 0 0 0;
}
div.fixed {
	position: absolute;
	top: 0;
	left: 0;
	width: <length>;
	height: 100%;
}
@media screen {
	html { overflow: hidden; }
	html[lang] { overflow: visible; }
	body { height: 100%; overflow: auto; }
	html>body { height: inherit; overflow: visible; }
	body>div.fixed { position: fixed; }
}
.algo {
	position: fixed;
}
</style>
</head>

<body>
<div class="fixed" id="algo">aquí va el contenido</div>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
<p>texto</p>
</body>
</html>
___________________

Felicidad
__________________
¡ hey, hou, hou, hey !