View Single Post
  #2 (permalink)  
Old January 1st, 2008, 05:15 PM
richard.york's Avatar
richard.york richard.york is offline
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts

1st question, depends on what you mean:

You mean if you set the width to px or % (but set no height) will height still be shrink-to-fit? Yes, it will. And if you set height to px or % (but set no width) will width still be expand-to-fit? Yes, it will.

If you set both width and height to px or % (or other measurements other than auto) then no, the width and height are no longer governed by those rules, the measurement replaces those models. Auto is the default value, so, auto means expand-to-fit (width) and shrink-to-fit (height), only when you explicitly define a value other than auto does that model go away for the particular property. Of course, relative, fixed, and absolute positioning change the rules, but that's covered in that chapter.

2nd question:
I can't say without seeing the complete markup and CSS.


Beginning CSS: Cascading Style Sheets For Web Design, 2nd Edition
CSS Instant Results