IE7 DIV width problem

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
 
M

Mark Rae [MVP]

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;">
 
P

PJ6

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top