[thelist] Shrink wrapping a div?

Maximillian Schwanekamp anaxamaxan at neptunewebworks.com
Thu May 13 15:38:49 CDT 2004


--------------------------
I.e. If I put Xpx-wide element inside the div, I want the
> div to
> be Xpx wide (plus padding and border), not 100% of the content
> width for its
> parent.

.somediv{display: inline}
--------------------------

Thanks, but as always I should have phrased the question better.  Using
display: inline; sorta works, but not quite.  I am wanting to center a div
of arbitrary width (depending on dynamic content), and give it a border that
just frames the content.  Doing this with a fixed-width div is no problem,
but I am trying to style for a div of unknown precise width.

In days of yore, I would wrap a table around the content, give it
align="center" and call it a day.  Well, for the border, there would be
another table framing the first, but we won't talk further about nested
tables in mixed company.  Anyway, I am sure I am just missing something
here.

Maximillian Von Schwanekamp
Dynamic Websites and E-Commerce
www.NeptuneWebworks.com
voice: 541-302-1438
fax: 208-730-6504




More information about the thelist mailing list