Liz Castro wrote:
> I happened upon a strange thing by accident: by mistake I didn't set
> the width of a relatively positioned float explicitly, but nothing
> bad happened... I've tested it far and wide and I can't get it to
> break.
>
> #navbuttons {position:relative; float:right; z-index:1}
>
> And I looked all over the CSS specs and the only thing I could find
> was in section 9.4.3 on Relative positioning.
>
> It says
>
> "A relatively positioned box establishes a new containing block for
> normal flow children and positioned descendants."
>
> Does that mean the width is not necessary for relatively positioned
> floats?
>
> Or is there some other situation in which you don't have to specify
> the width of a float (for non-replaced elements)?
>
In CSS 2.1 10.3. Calculating widths, there is 10.3.5 Floating,
non-replaced elements [1]
"... If 'width' is computed as 'auto', the used value is the
"shrink-to-fit" width."
So no, it's not necessary.
... but there is IE/Mac that follows CSS2.0, and here,
9.5 Floats [2] says "A floated box must have an explicit width"
... but there is IE/Win up to 7: Fails to shrink-wrap under some
conditions, depending on the child element [3] (not related to any
specification).
I do not see the connection to relative positioning, but others will
correct me.
Ingo
[1] http://www.w3.org/TR/CSS21/visudet.html#q8
[2] http://www.w3.org/TR/1998/REC-CSS2-19980512/visuren.html#floats
[3] http://www.satzansatz.de/cssd/onhavinglayout.html#shrinkwrap
--
http://www.satzansatz.de/css.html
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/