


DIV CSS solves IE6, IE7, IE8, FF compatibility issues_html/css_WEB-ITnose
1. Compatibility issues under ie8, this is best dealt with, just convert it to ie7 compatibility. Add the following code to the head, and as long as it is compatible under IE7, it will also be compatible under IE8
2. Float floating causes double margin problem under IE6. This is the most common and best to deal with. !important solution, such as
margin-left:10px! important;/*Under IE7, IE8, FF it is 10PX*/;
margin-left:5px;/*The attribute written under IE6 is 5PX, but it is displayed as 10px
3. Clear the block display. This can solve the block caused by floating. After the block is formed, when the DIV background is filled with color or picture, the background will be disconnected or a small block will appear. This kind of compatibility does not appear too often. I have only encountered it twice so far. The method is to write a display: block or other attributes in the CSS where the compatible DIV appears. I don’t know what it means in Chinese. I am English Poor, but it can achieve the desired effect, 6 e" Z e% |8 G# |
4. Many friends will see it when DIV CSS, but it is fine in several IE browsers. But something went wrong in FF. Using !important will make IE7 incompatible, which is a headache. I was wondering if there is any way to operate it only in FF. I have used this method, and it seems to be unsatisfactory. That is to add symbols in front of the attributes, such as: *, &, ¥, #, @, ?,. The attributes with symbols are only recognized by IE browsers, but not by FF. The method is as follows (note the attributes with symbols and attributes without symbols) The order of the attributes)
height:100px;/*The height of 100 is displayed under FF*/
height:120px;/*The height of 120 is displayed under IE678*/
5. Sometimes, during layout, it is found that a DIV is floating, and the next DIV is supposed to be displayed below, but ends up above it. This situation usually occurs under FF, and it can be solved. The way is to clear the float, add a DIV below the DIV that has been set to float, and write clear:both; in the CSS as follows
6. Then there is centering Problem, this problem occurs a lot for novices. The main reason is that they don’t understand the box model well and don’t memorize the box model. If you find that your page does not have a game, I now know that there are several reasons: 1. One is that there is no box. , which is the big DIV after BODY that holds all the DIVs together. You didn't write it. 2. You did, but the width didn't use absolute width: instead, it used a relative width. In the middle of the game, absolute width must be used. . -
7. Extension: If I want to achieve three different effects under IE6, IE7, and FF when designing, such as red background under IE6, blue under IE7 and green under FF, here, I have tried it myself, and it works, using a compatible method (pay attention to the order, you can understand it better) 7 L& t- o7 k- a1 I
background:red;/*The red color shown in FF*/<.>
background:blue !important;/*The blue color shown below IE7*/background:green;/*The green color shown below IE6*/
Here, I I want to say that although compatibility brings you a lot of depression and upsets, at the same time, after you do it too much, you will find that compatibility can sometimes satisfy you with many difficult-to-achieve effects, just like the last one. To achieve that kind of effect, you don’t need to use compatibility methods, then you can use JS. You also have to think about the differences between FF and IE for JS. Of course, I don’t know how to use JS compatibility. I haven’t studied it. For the future, let’s learn CSS DIV first.
Do more, practice, and always keep the box model in your mind. Only then will you become proficient and able to use it freely. Only then will you naturally know where there are compatibility issues when doing it. Just do it before testing. Troubleshoot the most common compatibility issues.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.
