Advertisement

08.18.2008 at 08:09PM PDT, ID: 23658440 | Points: 50
[x]
Attachment Details

div width containing an img

Asked by bhomass in Cascading Style Sheets (CSS)

when I have a div containing an img, and the image width is set to 60 using css, the div width is set to width:auto, shouldn't the div hug right around the image and keep a width of 60 +padding?

<div style="width:auto" >
   <img src=... width="60" >
</div>

But when displayed, the div stretches to full size of its container, which is a Td.

why is it not autosized to the img? do I misunderstand the property of width:auto?
Start Free Trial
 
 
[+][-]08.18.2008 at 08:44PM PDT, ID: 22257116

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.18.2008 at 09:18PM PDT, ID: 22257198

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2008 at 10:33AM PDT, ID: 22261944

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.19.2008 at 05:03PM PDT, ID: 22265060

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2008 at 05:29PM PDT, ID: 22265176

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.25.2008 at 09:50PM PDT, ID: 22311678

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628