1.png24
Bit picture iniE6
The background appears on the browser
- Solution: Make it
PNG8
Or you can refer to a script.
2. Browser defaultmargin
andpadding
different
- Solution: Add a global one
*{margin:0; padding:0; }
To unity.
3. IE6
Bilateral is apart from thebug
In:IE6
If the float is set on the element and is set at the same timemargin-left
ormargin-right
.margin
The 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: In
float
Added to the label style control_display:inline
; Convert it to an inline property. (_ this symbol is only availableie6
Identifies)
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;Firefox
Under, can only usegetAttribute()
Gets custom attributes
- Solution: Unified pass
getAttribute()
Gets custom attributes
6. IE
Next,event
The object has x and y attributes, but does notpageX
,pageY
Properties;Firefox
Next,event
Object has apageX
,pageY
Attribute, but no x, y attribute
- Solution :(conditional comment) the disadvantage is that in Internet explorer you may add additional
HTTP
The number of requests.
7.Chrome
In Chinese, the default value is less than12px
The text is forced according to12px
According to
- Solution: By joining
CSS
attribute-webkit-text-size-adjust: none
; To solve
8. After a hyperlink visithover
The style does not appear, the hyperlink style that was visited by the click is no longer availablehover
和 active
了
- Solution: Change
CSS
The 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 writingDTD
The statement,Firefox
Web 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.margin
Overlap problem:ie
andff
Both exist, the two next to each otherdiv
themargin-left
andmargin-right
They don’t overlap, butmargin-top
andmargin-bottom
There’s going to be overlap.
- Solution: Develop good coding habits and adopt them
margin-top
Or bothmargin-bottom
.
11. ie6
rightpng
Image 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!