Ver Mensaje Individual
  #4 (permalink)  
Antiguo 09/08/2010, 09:59
Avatar de chichote
chichote
Colaborador
 
Fecha de Ingreso: diciembre-2004
Ubicación: Santiago - Chile
Mensajes: 1.868
Antigüedad: 19 años, 4 meses
Puntos: 145
Respuesta: Crear div con altura fija y scroll horizontal

Creo que todos se han complicado mucho, es mucho mas simple de lo que se piensa. Con css solo debes definir el ancho y alto y utilizar la magia de "overflow: auto;" y listo, cuando sea necesario te aparecera el scroll automaticamente, ya sea horizontal o vertical.

te dejo un pequeño ejemplo que lo grafica.

Código HTML:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
</head>
<style>
.scroll
	{
	width:200px;
	height:100px;
	overflow: auto;
	border:1px solid #000000; /* Solo lo puse para que se vea el cuadro*/
	}
.titulo
	{
	color: #000000;
	background:#00FF00;
	font-weight: bold;
	}
</style>
<body>
<div class="scroll">
hola
<br />
<br />
chau
<br />
<br />
<br />
<br />
<br />
<br />
<table width="300">
  <tr>
    <td class="titulo">COLUMNA1</td>
    <td class="titulo">COLUMNA1</td>
    <td class="titulo">COLUMNA1</td>
  </tr>
</table>
</div>
</body>
</html> 
saludos
__________________
http://chicho.ninja yiaaaa