David Dorward <[EMAIL PROTECTED]> wrote:
> 
> On 21/11/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > Ideally, I'd like the sidebar width to adjust automatically to its
> > contents, as in table-based design (oops... sorry for using a rude
> > word :) but I don't think it's possible in CSS2 -- or is it?
> 
> display: table-cell (if only MSIE supported CSS 2).

OK, thanks for the hint. I have two div's, sidebar and contents, both
with display: table-cell, and it works fine. It's even better than
with a real table, because if the text becomes so big that they don't
fit side-by-side, the contents is moved below the sidebar, which is
much better than a horizontal scrollbar.

Now, for a more difficult one.

In my sidebar I have an image which I would like to scale to the
sidebar width. If the sidebar had a fixed width, I'd set the image to
"width: 100%". But with a table-cell sidebar, it expands to the width
of the containing block!

Let me summarize:

I have a block that contains dynamically generated text, and an image.
I would like the width of this block to be determined by its textual
contents, and the image scaled to fit that width. Any ideas?

Nicolas
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to