IE7 DIV width problem

  • Thread starter Thread starter PJ6
  • Start date Start date
P

PJ6

In IE6 I can force a DIV to automatically size to the width of its contents
by setting its width to 1px. This doesn't work in IE7, it tries to render
the DIV at the specified width, cutting off its contents. If I remove the
width entirely, the DIV goes to 100% of the screen width. Will I not be able
to have any shrink-to-fit DIV's in IE7?

Paul
 
PJ6 said:
In IE6 I can force a DIV to automatically size to the width of its
contents by setting its width to 1px. This doesn't work in IE7, it tries
to render the DIV at the specified width, cutting off its contents. If I
remove the width entirely, the DIV goes to 100% of the screen width. Will
I not be able to have any shrink-to-fit DIV's in IE7?


Are you doing it like this: ?

<div style="width:auto;">
 
PJ6 said:
width:auto causes the DIV to size to 100% of the page

Never mind, I foudn the problem. I had a buried element within the DIV that
was 100% width.

Thanks,
Paul
 
Back
Top