Some important differences between IE and the FF browser:
· IE does not have the same centering method as ff.
(1) An example of how the body can be centered in both IE and FF browsers:
[HTML]View Plaincopyprint?
- <html>
- <head>
- <title> Let the Body Container center in the browser </title>
- <link rel="stylesheet" type="text/css" href= "body_center.css">
- </head>
- <body>
- <div id="container">
- </div>
- </Body>
- </html>
BODY_CENTER.CSS file:
[HTML]View Plaincopyprint?
- Body {
- margin:0px;
- padding:0px;
- font:12px Arial, song body;
- Text-align:center;
- }
- #container {
- margin:0 Auto;
- width:90%;
- height:500px;
- Background:green;
- Text-align:left;
- }
· ie the default minimum height is 18px, the height of the 18px is the 18px display, and the FF browser specifies how many pixels to display.
(2) Examples:
[HTML]View Plaincopyprint?
- <html>
- <head>
- <title>ie Browser less than 18px height how normal display </title>
- <link rel="stylesheet" type="text/css" href= "llq_chayi.css">
- </head>
- <body>
- <div id="container">
- <div id="header">
- </div>
- <div class="Fenge"></div>
- <div id="main">
- </div>
- <div class="Fenge"></div>
- <div id="Footer">
- </div>
- </div>
- </Body>
- </html>
LLQ_CHAYI.CSS file:
[HTML]View Plaincopyprint?
- Body {
- margin:0px;
- padding:0px;
- font:12px song body;
- }
- #header {
- width:100%;
- height:80px;
- background:red;
- }
- #main {
- width:100%;
- height:600px;
- Background:yellow;
- }
- #footer {
- width:100%;
- height:80px;
- Background:blue;
- }
- . fenge {
- width:100%;
- height:10px;
- Clear:both;
- Overflow:hidden;
- }
• The default internal and external margins between browsers are different, body style Traditional Chinese medicine to margin and padding clear 0.
• Specifies the height of the chunk (that is, a div), ie automatically adjusts the height when the content of the chunk exceeds the height of the setting, and FF does not. Therefore, the way to solve this problem is not to specify the height of the block.
· Blocks in FF are displayed in accordance with the floating principle after using the floating attribute, but IE does not follow the floating principle. Therefore, in the use of floating chunks to remember the parent block also floating out of the document flow, clear floating, etc. to ensure browser compatibility.
· There is a big difference between IE and FF in the list attribute, the main manifestation is different from the default setting of the outer margin. Therefore, in order to ensure the compatibility of the two, the general UL style to the margin and padding first clear 0.
H1-h6 labels are not the same inside and outside margins, so the margin and padding are cleared 0.
• Border border width affects compatibility. In IE, width specifies the sum of the widths of the border plus the width of the content, and FF is only the width of the content not border. The way to solve this problem is to set the width value to two settings in the style sheet of an element, where the "widt= value!" Important "This is for FF, and this setting does not work for IE. However, setting a "width= value" for IE can be solved.