On Wed, Jun 6, 2012 at 2:51 PM, mem <talofo.l...@gmail.com> wrote:
> On Jun 6, 2012, at 18:02 , Georg wrote:
>
>> On 06.06.2012 18:16, mem wrote:
>>> Can you please take a look on the following snipped and either edited 
>>> and/or explain here, why, when we add a *percentage* value on margin, we 
>>> get some li to drop the float ?
>>>
>>> http://jsfiddle.net/vNmjS/
>>
>> Question: how wide is the float? :-)
>
> I believe it is, as wide as their contents.
> And that should be X% wide.
> But not 100% wide, unless, their contents correspond to the totality of the 
> container.
>
> I still not get with if we do px or em it don't drop, and if we use % it 
> drops...
>
>
>>
>> A more normal way to do this, is to declare...
>>
>> div#container {
>> float: right; /* or 'left' */
>> text-align: right;
>> width: 100%;
>> }
>>
>> ...which provides enough space in most cases. The ul itself will of course 
>> work fine as only container, with a similar styling.
>
> I see that we float right an element of 100% width. That seems to take no 
> effect on their contained elements, it only takes effect when we text-align: 
> right the inline or text elements inside.
> Indeed it works but I still don't totally understand the solution.
>
> Why should we declare a width of 100% will it not normally taken as 100% by 
> default ?

Floating an element causes it to constrict to the width of it's contents, no?


-- 

Tom Livingston | Senior Interactive Developer | Media Logic |
ph: 518.456.3015x231 | fx: 518.456.4279 | mlinc.com
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
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