1.png24Bit picture iniE6The background appears on the browser

  • Solution: Make itPNG8Or you can refer to a script.

2. Browser defaultmarginandpaddingdifferent

  • Solution: Add a global one*{margin:0; padding:0; }To unity.

3. IE6Bilateral is apart from thebugIn:IE6If the float is set on the element and is set at the same timemargin-leftormargin-right.marginThe value will double.

#box{ float:left; width:10px; margin:0 0 0 10px; }
Copy the code

In this case IE will create a distance of 20px

  • Solution: InfloatAdded to the label style control_display:inline; Convert it to an inline property. (_ this symbol is only availableie6Identifies)

4. The method of progressive recognition, gradually exclude the part from the whole.

First of all, the clever use of the “\9” mark, the IE viewer from all the situation out. Then, use “+” again to separate IE8 and IE7 and IE6, so that IE8 has been independently identified.

.bb{
    background-color:#f1ee18; /* All identified */
    .background-color:#00deff\9; /*IE6, 7, 8 recognize */
    +background-color:#a200ff; /*IE6, 7 recognition */
    _background-color:#1e0bd1; Identify * / / * IE6
} 
Copy the code

5. In Internet Explorer, you can obtain a custom attribute using the same method as obtaining a general attributegetAttribute()Get custom attributes;FirefoxUnder, can only usegetAttribute()Gets custom attributes

  • Solution: Unified passgetAttribute()Gets custom attributes

6. IENext,eventThe object has x and y attributes, but does notpageX,pageYProperties;FirefoxNext,eventObject has apageX,pageYAttribute, but no x, y attribute

  • Solution :(conditional comment) the disadvantage is that in Internet explorer you may add additionalHTTPThe number of requests.

7.ChromeIn Chinese, the default value is less than12pxThe text is forced according to12pxAccording to

  • Solution: By joiningCSSattribute-webkit-text-size-adjust: none; To solve

8. After a hyperlink visithoverThe style does not appear, the hyperlink style that was visited by the click is no longer availablehoveractive

  • Solution: ChangeCSSThe order in which attributes are arrangedL-V-H-A
a:link {}
a:visited {}
a:hover {}
a:active {}
Copy the code

9. Weird pattern problem: Missing writingDTDThe statement,FirefoxWeb pages will still be parsed in standard mode, but inIE“Triggers weird mode. To avoid unnecessary trouble with weird schemas, it’s best to get into the habit of writing DTD declarations. Now availablehtml5Recommended writing:

Up and down 10.marginOverlap problem:ieandffBoth exist, the two next to each otherdivthemargin-leftandmargin-rightThey don’t overlap, butmargin-topandmargin-bottomThere’s going to be overlap.

  • Solution: Develop good coding habits and adopt themmargin-topOr bothmargin-bottom.

11. ie6rightpngImage format support is poor

  • Solution: Refer to a script process

Recommendation:

  • 020 continue to update, boutique small circle has new content every day, dry goods concentration is very high.
  • Strong contacts, discussion technology you want here!
  • Be the first to enter the group and beat your peers! (There is no charge to join the group)
  • Group no. : 779186871

Upon application:

  • BAT Factory interview questions, exclusive interview kit,
  • Materials for free, including all kinds of interview questions and answers sorted out, the big factory interview questions to share!