IE7 DIV width problem

Discussion in 'ASP .Net' started by PJ6, Sep 14, 2007.

  1. PJ6

    PJ6 Guest

    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, Sep 14, 2007
    #1
    1. Advertising

  2. "PJ6" <> wrote in message
    news:...
    > 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;">


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
     
    Mark Rae [MVP], Sep 14, 2007
    #2
    1. Advertising

  3. PJ6

    PJ6 Guest

    "Mark Rae [MVP]" <> wrote in message
    news:...
    > Are you doing it like this: ?
    >
    > <div style="width:auto;">


    width:auto causes the DIV to size to 100% of the page

    Paul
     
    PJ6, Sep 14, 2007
    #3
  4. PJ6

    PJ6 Guest

    "PJ6" <> wrote in message
    news:...
    > "Mark Rae [MVP]" <> wrote in message
    > news:...
    >> Are you doing it like this: ?
    >>
    >> <div style="width:auto;">

    >
    > 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
     
    PJ6, Sep 14, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AndrewF
    Replies:
    1
    Views:
    850
    Bruce Barker
    Oct 10, 2005
  2. =?Utf-8?B?cm9kY2hhcg==?=

    how to: div width = browser.width?

    =?Utf-8?B?cm9kY2hhcg==?=, Oct 27, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    559
    =?Utf-8?B?cm9kY2hhcg==?=
    Oct 30, 2006
  3. Jeff Louella

    IE7 on XP vs IE7 on Vista

    Jeff Louella, Mar 1, 2007, in forum: HTML
    Replies:
    9
    Views:
    564
    Adrienne Boswell
    Mar 2, 2007
  4. Steve Richter
    Replies:
    2
    Views:
    8,011
    Steve Richter
    Jun 15, 2007
  5. Tom Y
    Replies:
    1
    Views:
    245
    Elegie
    Jul 12, 2011
Loading...

Share This Page