Afficher un message
Vieux 20/03/2008, 07h22   #2
John Hosking
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: min-height current wisdom

Jeff wrote:
> I need to set a minimum height for a div, yet have it expand with the
> contents.
>
> I have this from 2005:
>
> <style type="text/css">
> div{
> height: 12px;
> background-color: red;
> 1px solid black;min-height:12px


Missing a border: above?

> }
>
> html>body div{
> height: auto; /* for not-IE */


More accurate: /* for IE6 and below */

> }
> </style>
>
> <div>one<br>two</div>
> <br>


ick

> <div></div>
>
> That works in my Firefox 2.0, Opera 9 and IE6 win XP.
>
> Is that still the current best wisdom on this task? This still works
> in IE7?


No. See "html > body" child selector filter (and the rest of the page)
at http://msdn2.microsoft.com/en-us/library/bb250496.aspx


--
John
Read about the UIP: http://improve-usenet.org/
  Réponse avec citation
 
Page generated in 0,04627 seconds with 9 queries