Posted by Jonathan N. Little on 05/17/06 20:59
Vadim wrote:
> Hi!
> Why I can't see the parent background on child divs?
> Thanks
>
> <div id="Chrono_Actions">
> <div class="Last_Transaction">aaa</div>
> <div class="Last_Comments">bbb</div>
> </div>
>
> <style>
> #Chrono_Actions
> {
> background-color: #ecf6d9;
> }
>
> #Chrono_Actions .Last_Transaction
> {
> float: left;
> }
>
> #Chrono_Actions .Last_Comments
> {
> float: right;
> }
> </style>
>
Because div "Chrono_Actions" has no content. Once you make the child
div's float they are no longer part of rendering flow of the container.
Prove it by adding some content....
div id="Chrono_Actions">
<div class="Last_Transaction">aaa</div>
<div class="Last_Comments">bbb</div>
Now you will see the background...
</div>
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Navigation:
[Reply to this message]
|