Difference in IE Firefox CSS

Source: Internet
Author: User
1. Organization issues
Problem: the IE value of any distance can be left with no unit. The FF value must be written in units (except 0)
Solution: Write All units such as padding: 0px;

2. horizontal center
Problem: For content in Div, ie is center by default, and FF is left by default.
Solution: mairgin: 0px auto;

3. High Problems
Problem: If the height of a div is set, when the actual content in the DIV is greater than the height, ie will automatically stretch to adapt to the size of the DIV container, and FF will fix the DIV's instructions, if the part exceeds the bottom line of the DIV, it overlaps with the following content.
Solution: control the appropriate height, or disable writing, so that the browser can automatically adjust the height, or set overflow: hidden;

4. Clear: both;
Problem: If the n-column div is controlled by float, ie will automatically check the automatic arrangement below, and FF may be unhonest and messy everywhere.
Solution: add clear: both to the next label after the float ends to end the float control.

5. Maximum/small width Problem
Problem: Min-width and max-width are only FF commands. How can I make ie achieve the same effect?
Solution: IE does not know Min-And Max-. ie actually thinks that Min-width, Max-width, and width have the same effect. You can solve this problem using the following method:
# Cctext {
Min-width: 700px;
Max-width: 1000px;
Width: expression (document. Body. clientwidth <700? & Quot; 700px & quot;: Document. Body. clientwidth & gt; 1000? "1000px": "Auto ");
}

6 ,! Important Support
Problem: FF does not support IE
Solution: none. IE will ignore.

7. cursor status
Problem: cursor: hand; only supported by IE. The Finger status is displayed.
Solution: Both cursor: pointer; IE and FF are supported.

8. Actual pixels
IE/Opera: actual width of the object = (margin-left) + width + (margin-right)
Firefox/Mozilla: actual width of the object = (margin-left) + (border-left-width) + (padding-left) + width + (padding-right) + (border-right-width) + (margin-right)
Therefore, the display width of IE and FF is slightly different when the tables are arranged and columns are arranged.

1. Organization issues
It is related to the DTD, not the browser. If the DTD is XHTML, the Unit must be added.

2. horizontal center
I don't understand .. However, mairgin: 0px auto; is used to center the DIV itself.

4. Clear: both;
IE is not honest, and floating will not occupy space.

5. Maximum/small width Problem
It can be done with hack, _ height, _ width

6. IE7 is also supported! Important

8. Is it weird and standard?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.