Ver Mensaje Individual
  #9 (permalink)  
Antiguo 05/01/2007, 16:15
zsamer
 
Fecha de Ingreso: noviembre-2003
Mensajes: 798
Antigüedad: 20 años, 4 meses
Puntos: 8
Re: Misma altura a diferentes divs

es sencillo:

Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="content-type" content="text/html; charset=utf-8" />
<
title>Example In search of the One True Layout Equal Height Columns</title>
<
style type="text/css">
/* <![CDATA[ */
#block_1
    
{
    
floatleft;
    
width34%;
    
margin-left33%;
    }
html #block_1
    
{
    
displayinline;
    }
#block_2
    
{
    
floatleft;
    
width33%;
    
margin-left: -67%;
    }
#block_3
    
{
    
floatleft;
    
width33%;
    }
/* Start Mac IE5 filter \*/
#block_1, #block_2, #block_3
    
{
    
padding-bottom32767px !important;
    
margin-bottom: -32767px !important
    }
/* End Mac IE5 filter */
#wrapper
    
{
    
overflowhidden/* This hides the excess padding in non-IE browsers */
    
}
/* we need this for IE 5.01 - otherwise the wrapper does not expand to the
necessary height (unless fixed, this problem becomes even more acute 
weirdness as the method is enhanced */
#wrapper
    
{
/* Normally a Holly-style hack height: 1% would suffice but that causes 
IE 5.01 to completely collapse the wrapper - instead we float it */
    
floatleft;
/* NB. possibly only IE 5.01 needs to get this float value - otherwise 5.5 sometimes 
(I saw it happen many moons ago) makes the width of wrapper too small 
the float: none with the comment is ignored by 5.01,
5.5 and above see it and carry on about their business
It's probably fine to just remove it, but it's left here 
just in case that many moons ago problem rears its head again */
    
float/**/none;
    }
/* easy clearing */
#wrapper:after
    
{
    
content'[DO NOT LEAVE IT IS NOT REAL]'
    
displayblock
    
height0
    
clearboth
    
visibilityhidden;
    }
#wrapper
    
{
    
displayinline-block;
    }
/*\*/
#wrapper
    
{
    
displayblock;
    }
/* end easy clearing */
#footer
    
{
    
clearboth;
    }
/* Safari needs this - otherwise the ghost overflow, though painted 
correctly obscures links and form elements that by rights should be above it.
An unintended side-effect is that it cause such elements to vanish in IE 5.01
and 5.5, hence the child selector hack */
* > #footer, * > form, * > #notes, * > .output
    
{
    
positionrelative;
    
z-index1000;
    }
/* ]]> */
</style>
<
style type="text/css">
@
import url(onetruelayout3.css);
</
style>
</
head>
<
body>
<
div id="header">
<
h1>Equal Height Columns</h1>
</
div>
<
div id="wrapper">

<
div id="block_1">
<
h2>Block 1</h2>
<
p>Filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler</p>
<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p>

<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p><p>Filler</p>
<
p>Filler</p>

<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p>

<
p>Filler</p>
<
p>Filler</p>
<
p><a href="http://www.fu2k.org/dev/null" title="Dummy link to test that link works OK">Last filler</a></p>
</
div>
<
div id="block_2">
<
h2>Block 2</h2>
<
p>Filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler</p>
<
p>Filler</p>
<
p>Filler</p>
<
p>Filler</p>

<
p><a href="http://www.fu2k.org/dev/null" title="Dummy link to test that link works OK">Last filler</a></p>
</
div>
<
div id="block_3">
<
h2>Block 3</h2>
<
p>Filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler</p>
<
p>Filler</p>
<
p>Filler</p>
<
p><a href="http://www.fu2k.org/dev/null" title="Dummy link to test that link works OK">Last filler</a></p>
</
div>
</
div><!-- close div#wrapper -->
<div id="footer">

<
p><a href="http://www.fu2k.org/dev/null" title="Dummy link to test that link works OK">Footer text</a></p>
</
div>
</
body>
</
html