Mark Finney wrote:
In IE 6/7 the containing division needs an implicit width set:
/*7.0*/
*:first-child + html div {width : 350px; }
/*6.0*/
* html div {width : 350px; }
reference :: on having layout
<http://www.satzansatz.de/cssd/onhavinglayout.html>
Best,
~d
--
:: desktop and mobile ::
http://chelseacreekstudio.com/
Thanks for getting back so fast... I am reading through the hasLayout
article now - very interesting.
Slightly confused though - setting the width does solve the problem by
fixing the width of the containing division so the p only stretches
that far but that removes the point of floating that div in the first
place. What I want (if it is possible) is to achieve a solution that
allows me to right-align items (like the link in the example). I am
only floating the div to make it automatically wrap to the contents
width. Then I can right align children like the link against this
container... sorry if that is a confusing explanation.
Somewhat. If you want the text in the link to the right, then doesn't
this work.
<div style="float:left;">
<p>Some paragraph <a href="#" style="">Interesting
Link</a></p>
</div>
I read that
floating a div triggers hasLayout already but tested the same with
zoom:1; to no avail...
I don't understand why the width of the division changes when I add
the paragraph - without it the div wraps as desired.
This has more to do with you having a floated right element inside a
floated left element whose width is auto.
<http://css-class.com/test/css/visformatting/floats/floats-width-auto.htm>
There is no possible way to stop this bug so something has to have a
width.
Anyway, since you do have floats, you have quite a few bugs happening
at once. The fix up, is not nice.
*:first-child+html p {margin: 1em 0; width: 13em;}
*:first-child+html p a {margin-top: -1.2em;}
I can set the width as per your solution and use JS to overwrite it to
the width of its dynamic content each time but that just seems ugly...
Much thanks for your expertise,
Mark
That could get ugly, I suggest not to float the link.
--
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/