Ver Mensaje Individual
  #15 (permalink)  
Antiguo 22/10/2012, 11:55
Avatar de flashmax
flashmax
 
Fecha de Ingreso: julio-2012
Ubicación: Bs.As. Argentina
Mensajes: 507
Antigüedad: 11 años, 9 meses
Puntos: 86
Respuesta: centrar verticalmente texto en un div

hola te de un ejemplo de centrado vertical:

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" />
<head>

 
<style type="text/css">
 
.contenedor-link {
    width: 100px;
	border: #000 solid 1px;
    height: 100px;
    color:#00CCFF;
    font-family:Georgia, "Times New Roman", Times, serif;
    font-size:20px;
	}
    
.contenedor-link[class] { 
    display: table;}
    
.centrado {
    position: absolute; 
    top: 50%;}
 
.centrado[class] {
    display: table-cell; 
    vertical-align: middle;
    text-align: center; 
    position: static;
    }
    
.link{
	width: 100px;
    height:auto;
    margin: 0 auto;
    position: relative;
    top: -50%;  
    }

</style>
 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div class="contenedor-link">
    <div class="centrado">
        <div class="link">link</div>
    </div>
</div>
</body>
 
</html> 
__________________
Saludos!
----------------------------------------------------------