Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

min-width for ie6

  • 06-08-2009 05:07PM
    #1
    Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭


    I have my website looking perfect in all browsers except for IE6, which insists on stretching out to be the entire width of the page. I have min-width specified but it's ignoring it.

    Having searched on google, and found only messy solutions which don't really work, I'd like to hear how people on here approach this problem.

    My div needs to stretch in width to fit its content but should be at least 780px. Who would've thought this would be a problem?? :rolleyes:


Comments

  • Registered Users, Registered Users 2 Posts: 8,488 ✭✭✭Goodshape


    IE6 doesn't understand min-width. It will just ignore it.

    Instead, IE6 treats 'width' in the same way that most browsers treat 'min-width'. That is, if you set 'width' for IE6 the container will still stretch if the content is too long (most browsers will chop the content off, and rightly so).

    You can load a IE only stylesheet and add width declarations anywhere you should have min-width.


    If that all sounds confusing and annoying -- you're right. It is.


  • Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭John_Mc


    Hi thanks for your reply, I only just stumbled across that fact now.

    My problem is that I have a layout like so

    <div id="wrapper">

    <div id="header"></div>

    <div id="content"></div>

    </div>

    Header should be a div running the full width of the content div and located just above it.

    However, sometimes the content exceeds the min-width of 780px and when it does. the header should match it's width. This is where my problem is now :(


  • Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭John_Mc


    I have it working as it should in all browsers now except for IE7.

    My Doc type is strict but it's ignoring the min-width property and my div is expanding the full width of the page.

    Any suggestions?


  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    John_Mc wrote: »
    Hi thanks for your reply, I only just stumbled across that fact now.

    My problem is that I have a layout like so

    <div id="wrapper">

    <div id="header"></div>

    <div id="content"></div>

    </div>

    Header should be a div running the full width of the content div and located just above it.

    However, sometimes the content exceeds the min-width of 780px and when it does. the header should match it's width. This is where my problem is now :(

    min-width definitely wouldn't solve that.

    Will setting the header to 100% work, using an IE conditional width of 780 for the wrapper ?

    Failing that, check out jQuery and set the header width to the width of the content.


Advertisement