posición: solucionado que no funciona para Internet Explorer 6. Realmente no puedo entender las soluciones encontradas en google. Necesito que funcione en IE6, IE7, IE8 & FireFox 3.0.IE 6 frente a posición: fijo
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" />
<title>Sidebar fixed</title>
<style type="text/css">
#wrapper {
position:relative;
width:900px;
margin:0 auto 0 auto;
}
#sidebar_left {
position:fixed;
height:200px;
width:200px;
border:1px solid #000;
}
#sidebar_right {
position:fixed;
height:200px;
width:200px;
margin-left:700px;
border:1px solid #000;
}
#content {
position:absolute;
height:2000px;
width:480px;
margin-left:210px;
border:1px solid #000;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="sidebar_left">
<p>Left sidebar</p>
</div>
<div id="sidebar_right">
<p>Right sidebar</p>
</div>
<div id="content">
<p>This is the content</p>
</div>
</div>
</body>
</html>
¡Funciona bastante bien! Pero, ¿y si tengo un encabezado? ¿Se puede modificar para ir a la cima cuando se ha pasado el encabezado? – Cudos
"No es compatible con IE6" es fácil de decir (lo digo a menudo), pero a veces simplemente no tiene la opción. – mbillard
Un encabezado debería funcionar bien, ya que este código simplemente corrige la posición: arreglado para IE6 en lugar de interferir con su diseño de otra manera. Sin embargo, es un hack, por lo que puede encontrar situaciones en las que se rompe; realmente dependerá de su diseño final. – Mathew