MOHAMMED NASEER wrote:
> I'm trying to understand floats and related matters. I have a  
> question, is the 'containing element' in which an element is floated  
> either to the left or right


An element floated left will have its' left edge against the left edge
of its' "containing block".

<div id="container">
   <div id="float-left">...</div>
</div>

> - can it be any element, in which the  
> floated element happens to be nested  or wrapped inside of. Or is it  
> only a block level element which happens to be wrapping that  
> particular floated element. If you could pls clarify it for me.
> thanks, Naz.


Any element can be floated, either a "block level element" or "inline 
element".

ul li {float: left;}

<ul>
   <li>...</li>
   <li>...</li>
   <li>...</li>
</ul>


In this case the <ul> element is the "containing block" for the floated 
<li>. This is still the same if the <ul> is floated itself.

A containing element is simply a parent container for a child element. I 
think that you are getting the terms "containing block" and "containing 
element" confused together.

<http://www.w3.org/TR/CSS21/visudet.html#containing-block-details>


A <div>, <ul> and <li> are all block level elements.

<http://www.w3.org/TR/CSS21/visuren.html#block-boxes>



-- 
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to