Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/11/2010, 16:39
marcelomp3
 
Fecha de Ingreso: septiembre-2008
Mensajes: 190
Antigüedad: 15 años, 7 meses
Puntos: 2
pequeño problema. DIV SIN MARGENES TIENEN MARGEN

hola gente queria consultarles porque estos divs concervan un margen que ni firebug ni el inspector de chrome justifican y como eliminarlo. Desde ya muchas gracias

SOLUCION: PARA QUE ESTO NO SUCEDA HAY QUE DEFINIR LA PROPIEDAD FLOAT CON VALORES RIGHT O LEFT.
Código CSS:
Ver original
  1. .mitad {float:right;}
  2. /* o si no*/
  3. .mitad {float:left;}

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3.  
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
  5.     <head>
  6.         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7.         <title>index</title>
  8.         <link type="text/css" rel="stylesheet" href="estilos.css" media="all">
  9.     </head>
  10.  
  11.     <body>
  12.         <div class="mitad"></div>
  13.         <div class="mitad"></div>
  14.         <div class="mitad"></div>
  15.         <div class="mitad"></div>
  16.     <body>
  17. </html>
Código CSS:
Ver original
  1. div {
  2.    padding: 0px; margin: 0px;
  3.   }
  4. .mitad  {
  5.   width: 100px;
  6.   height: 100px;
  7.   background-color: #00af00;
  8.   position: static;
  9.   background-color: #000;
  10.   display: inline-block;
  11.   }

Última edición por marcelomp3; 30/11/2010 a las 17:16