1

<html>
    
    <head>
    <meta charset="UTF-8">
    <style>
    .hello {
        background: red;
        height: 150px;
        overflow: auto;
        width: 100px;
        float: left;}
    </style>
    </head>
    
    <body bgcolor="#FFFFE0" text="#000000">
    <div class "divv">
    <div class="hello"> 
    
    </div>
    </div>
    </body>
    
    
    </html>

I dont understand why body and divv dont have the height of hello since they are wrapping around it. only html inherits its height(+default margin)

Sara
  • 53
  • 7

1 Answers1

-1

Its because you have a float on .hello The float takes the element out of the 'flow' of the document. I suppose this is to allow text to wrap around it.

conordarcy
  • 357
  • 1
  • 3
  • 9