Re: [WSG] Expand width of container to fit content's width?

2009-06-28 Thread David Hucklesby

(Joseph's reply moved to the bottom)


On 6/27/09 1:32 AM, David Hucklesby wrote:

Stevio wrote:

Is it possible to expand a container's width to fit its content?



Well, IE 6 treats "width" as "min-width" and likely does what you 
want. Non-IE browsers behave similarly if you add a "display: 
table;" declaration.


Don't know how to deal with IE 7 though... :(



Joseph Taylor wrote:
IE7 handles "min-width" just fine. You can also use a hack or 
conditional stylesheet to feed IE6 it's "width" style.




Perhaps I misunderstood, but I thought Stevio wanted the opposite effect
to min-width - namely, a width that expands if the content does not fit.

I don't know how to do that in IE 7.

Cordially,
David
--


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***



Re: [WSG] Expand width of container to fit content's width?

2009-06-27 Thread Joseph Taylor
IE7 handles "min-width" just fine. You can also use a hack or 
conditional stylesheet to feed IE6 it's "width" style.


Joseph R. B. Taylor
/Designer / Developer/
--
Sites by Joe, LLC
/"Clean, Simple and Elegant Web Design"/
Phone: (609) 335-3076
Web: http://sitesbyjoe.com
Email: j...@sitesbyjoe.com


On 6/27/09 1:32 AM, David Hucklesby wrote:

Stevio wrote:

Is it possible to expand a container's width to fit its content?



Well, IE 6 treats "width" as "min-width" and likely does what you 
want. Non-IE browsers behave similarly if you add a "display: table;" 
declaration.


Don't know how to deal with IE 7 though... :(

Cordially,
David
--



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***

Re: [WSG] Expand width of container to fit content's width?

2009-06-27 Thread Russ Weakley

Is it possible to expand a container's width to fit its content?

For example, if I have a page where the content is wider than the  
width available at the browser's current size, which means the  
horizontal scrollbar appear, I want the container to expand to fit  
the width of the content instead of having the content sticking out  
the side (because that makes the design of the page look poor when  
the user scrolls horizontally).


Thanks,
Stephen


Hey Stevio,

Without seeing a real example of what you are trying to achieve, it  
sounds like setting your container to a percentage width should do  
the job. Eg: #container { width: 100%; }


It will then expand and contract to the width of the browser window  
(or the width of a parent element if this parent has a width  
specified). Content will wrap inside this container as needed.


HTH
Russ



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***



Re: [WSG] Expand width of container to fit content's width?

2009-06-26 Thread David Hucklesby

Stevio wrote:

Is it possible to expand a container's width to fit its content?



Well, IE 6 treats "width" as "min-width" and likely does what you want. 
Non-IE browsers behave similarly if you add a "display: table;" declaration.


Don't know how to deal with IE 7 though... :(

Cordially,
David
--



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***



Re: [WSG] Expand width of container to fit content's width?

2009-06-26 Thread Paul Novitski

At 6/26/2009 12:58 PM, Stevio wrote:

Is it possible to expand a container's width to fit its content?

For example, if I have a page where the content is wider than the 
width available at the browser's current size, which means the 
horizontal scrollbar appear, I want the container to expand to fit 
the width of the content instead of having the content sticking out 
the side (because that makes the design of the page look poor when 
the user scrolls horizontally).



It's always a good idea to include a link to a page where your 
problem is actually occurring so we can give you pertinent advice.


Speaking in generalities, normal behavior is for a container to 
stretch to contain its content. However, if content is floated left 
or right or positioned absolutely or relatively, it's taken out of 
the flow and can visually extend beyond the boundaries of its 
containing block. The solution is often to float or relatively 
position the container. If the problem is that you've absolutely 
positioned your content, I would further recommend that you rethink 
that plan, as in most cases absolute positioning is an unnecessary, 
brute-force approach to solve a problem that can be handled much more 
gracefully with different styling.


Regards,

Paul
__

Paul Novitski
Juniper Webcraft Ltd.
http://juniperwebcraft.com 




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***



[WSG] Expand width of container to fit content's width?

2009-06-26 Thread Stevio

Is it possible to expand a container's width to fit its content?

For example, if I have a page where the content is wider than the width 
available at the browser's current size, which means the horizontal 
scrollbar appear, I want the container to expand to fit the width of the 
content instead of having the content sticking out the side (because that 
makes the design of the page look poor when the user scrolls horizontally).


Thanks,
Stephen 




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***