Check out tip 1 in the sitepoint Top Ten CSS Tricks article:
http://www.sitepoint.com/article/top-ten-css-tricks
As mentioned, block level elements default to 100% width unless specified, so one (of many) ways to change this, would be to specify "display: inline;".
Cheers,
Daniel Nitsche
On 10/4/05, Kara O'Halloran - Eduka <[EMAIL PROTECTED]> wrote:
Hi guys,
I have 2 divs inside a container.
1: a relatively positioned div to contain and position an image
2: another div, absolute position, to contain a submenu.
Image on left, menu on right.
For some reason, both divs are expanding horizontally to take up all the
available space, even when the content inside them is only 20 pixels
wide. I'm not specifying any widths because the content is dynamic so I
have no way of knowing what the width will be.
The only width I have specified is the container width of 60em.
Why are they doing this? Shouldn't they only expand horizontally to make
room for whatever is contained in them - in this case only a few words?
Any help would be appreciated. :)
K
(ps this happens in both ff and ie.)
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************
