RE: limiting width of div (or other container) to width of text

by "Ann Ezzell" <amcbainezzell(at)alum.mit.edu>

 Date:  Fri, 24 Jan 2003 07:09:19 -0700
 To:  "'Tim Rivera'" <lists(at)timrivera.com>,
<hwg-style(at)hwg.org>
 In-Reply-To:  riveraamd
  todo: View Thread, Original

I actually ended up changing the design for other reasons, but before I =
did,
I tried the inline thing, and it worked.

Thanks!

> -----Original Message-----
> From: owner-hwg-style(at)hwg.org=20
> [mailto:owner-hwg-style(at)hwg.org] On Behalf Of Tim Rivera
> Sent: Friday, January 24, 2003 4:22 AM
> To: hwg-style(at)hwg.org; amcbainezzell(at)alum.mit.edu
> Subject: Re: limiting width of div (or other container) to=20
> width of text
>=20
>=20
> > I believe the problem is that you are expecting a block element to
> > behave like an inline element. H1 and DIV are block elements, and
> > extend from the left to the right of the container. If you did
> > something like this:
> >
> > [h1][span id=3D"headerBoxTraining"]Header 1[/span][/h1]
> >
> > you might get what you want, since SPAN is inline.
>=20
>=20
> Yes, John hit the nail on the head with his response. You=20
> will need to use
> an inline element to do what you would like to do. Try this:
>=20
> #headerBoxTraining {
> border: 2px solid #ccc;
> border-left: 0;
> padding: 10px 5px 10px 0;
> }
>=20
> <h1><span id=3D"headerBoxTraining">Header 1</span></h1>

HWG hwg-style mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.