Strategy for Fixing Layout Bugs in IE6?

前端 未结 12 1573
别跟我提以往
别跟我提以往 2021-01-05 08:02

Generally, what\'s the best way to tackle a layout bug in IE6? What are the most common bugs or problems that one should look for when trying to figure out why your page sud

相关标签:
12条回答
  • Noticed that Marc's post is at a -2 =D. He's only saying "resort to tables" even though they blow, because in sucky browsers like IE6, some of the broken CSS commands work in tables only (who know's why... dam you Bill Gates!!!). Here's a good reference to see what works and doesn't work as far as CSS goes. http://www.quirksmode.org/css/contents.html . It's a great reference to check on what cool effects work/don't work with various, widely used browsers. Also, always have a go-to plan for users who browse with IE6 (even though it's just about as old as mechanical dirt) as many businesses still use older browsers (including non-profits/3rd world countries etc.) So by all means, create the bugged out drop-down menu that looks WAY better than a standard horizontal menu, but create a secondary one specifically for IE6 that becomes the default when the page receives a request from an IE6 browser.

    0 讨论(0)
  • 2021-01-05 09:00

    A common problem is padding not getting added to the width of a block element. So for layout div's, avoid using padding and instead use elements within them to define the padding.

    0 讨论(0)
  • 2021-01-05 09:03

    I have a simple strategy that works every time.

    First, I develop the site using commonly accepted CSS to look good in Safari and Firefox 3. See w3schools.com for details on browser support.

    Then, I go into IE6 and IE7 and alter the CSS using conditional includes.

    This is hack free and lets you handle different browsers (IE6 and IE7 have separate issues).

    Most of the issues you'll find come from unsupported features in IE (like min-width), errors in the box model (IE adds unseen extra padding (3px) to some boxes), or positioning issues. Go for those first as they are often the issue.

    0 讨论(0)
  • 2021-01-05 09:04

    First Things First

    Get yourself the Internet Explorer Developer Toolbar. It's a life saver and works great with IE6 and/or IE7. It's no replacement for Web Developer Toolbar or Firebug for Firefox, but it's better than nothing.

    Know Thy Enemy

    Read up on the quirks of IE — particularly hasLayout and overflow and the like. There are also many CSS niceties that you'll have to either do without or find alternatives. Look into how many of the popular JavaScript toolkits/frameworks/libraries get around different issues.

    Rome Wasn't Built in a Day

    The more you have to work with it, the more you'll remember off hand and won't have to lookup as often. There's just no replacement for experience in this. As several have pointed out, though, there are great resources out there on the net. Position Is Everything is certainly up there.

    0 讨论(0)
  • 2021-01-05 09:04

    This question I believe has far too much scope.

    Validate your code, and if pain persists, well, good luck.

    The only real solutions, as with any other ballpark bug type are to google for a solution, or ask somebody who knows, ( ie: give the exact problem to us here at stackoverflow ).

    You can use the IE Dev toolbar to glean an Idea, but many of the bugs are random, inexplicable, and esoteric. IE: the guillotine bug, the random item duplication bug, etc etc, the list goes on, and you can spend hours literally goofing with stupid variables everywhere and achieve nothing.

    0 讨论(0)
  • 2021-01-05 09:08

    In theory, use CSS compatible with IE6 layout bugs, utilise only well known workarounds (css and html filters) and code for them in a way that wont break forward compatibility, test for quirks/strict mode.

    In reality, resort to tables.

    0 讨论(0)
提交回复
热议问题