Gautam Patel wrote:
>
> I am trying to enclose an img tag in a <div> or <span> wrapper; and I want 
> the wrapper to resize automatically to the image size (i.e., I don't want to 
> specify a hard-coded size). Using float:left or float:right, this works. But 
> how do I manage it without a float?
>
>   
Your problem as I see it is that when you wrap the image and text (both 
of which are inline elements)in a <span>, which displays inline by 
default - it doesn't "behave" as you would like. The reason it appears 
to work when float is declared is because floating an inline element 
causes that inline element to display as a block element would. If you 
need to keep it a <span>, and don't want to float it but want the same 
type of behavior, then use display:block in the declaration instead of 
float:left.
  

}

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to