Ver Mensaje Individual
  #2 (permalink)  
Antiguo 31/07/2013, 23:42
Avatar de Naahuel
Naahuel
 
Fecha de Ingreso: marzo-2011
Ubicación: localhost
Mensajes: 796
Antigüedad: 13 años, 1 mes
Puntos: 192
Respuesta: Ajustar tamaño del texto a un div

¿El título o texto está en otro elemento como h1 o p? Si es así, asegurate de que no tengan padding or margin.

Sino, eso es el alto de línea. Lo solucionás poniendolo del mismo alto que la fuente:

Código CSS:
Ver original
  1. line-height: 1em;

Ejemplo:
Código HTML:
Ver original
  1. <!DOCTYPE html>
  2. <meta charset=utf-8 />
  3. <title>JS Bin</title>
  4.   <style>
  5.     .padre{
  6.       padding:25px;
  7.       margin-bottom: 10px;
  8.       background: #eee;
  9.     }
  10.     .hijo{
  11.       background: red
  12.     }
  13.     .correjido{
  14.       line-height: 1em;
  15.     }
  16.   </style>
  17. </head>
  18.   <div class="padre">
  19.     <div class="hijo">
  20.      texto
  21.     </div>
  22.   </div>
  23.   <div class="padre">
  24.     <div class="hijo correjido">
  25.      texto
  26.     </div>
  27.   </div>
  28. </body>
  29. </html>
__________________
nahueljose.com.ar