Solutions to various margin problems compatible with CSS of IE6, IE7, IE8, and Firefox-

Source: Internet
Author: User
External
. Main {float: Left; # Float: none; _ float: none;
HTML *. Main {float: Left; # Float: none; _ float: none ;}
* + Html. Main {float: Left; # Float: none; _ float: none ;}
* Html. Main {float: Left; # Float: none; _ float: none ;}
Lines 3 will be shown to Firefox and other browsers
Line 3 shows safari, IE6, and IE7. If the visual effects of safari, IE6, and IE7 are inconsistent, we need to follow the definition of IE6 and IE7.
3rd rows for IE7
Line 3 shows IE6 and older versions

Built-in
. Main {float: Left; # Float: none; _ float: none; [float: none;] float: none ;}
1st float for Firefox and other browsers
2nd plus # Float for IE7
Display the 3rd increment float to IE6 and earlier versions.
4th float values added to [For Safari
5th plus] float for IE
Rendering Engine)
Mozilla Firefox (gecko)
Internet Explorer (Trident)
Opera (presto)
Konqueror (khtml)
Safari SWIFT (WebKit)

Use CSS to automatically hide content beyond the width and omit the display. The browser is compatible with IE and ff.
Text-overflow: ellipsis;
-O-text-overflow: ellipsis;
-ICAB-text-overflow: ellipsis;
-Khtml-text-overflow: ellipsis;
-Moz-text-overflow: ellipsis;
-WebKit-text-overflow: ellipsis;
The private attributes of browsers that are basically non-ie will start with-xxx,
-O-is a private,
-ICAB-private to ICAB,
-Khtml-is a khtml-based browser (such as Konqueror Safari ),
-Moz-is a browser that uses Mozilla's Gecko as the engine (such as Firefox and Mozilla ),
-WebKit-a browser (such as safari and swift) that uses the WebKit rendering engine (derived from khtml ).
It doesn't mean that like-moz-text-overflow is now useful, but an imaginary way of writing. When a browser developer decides to support a property that has not yet been recognized, generally,-xxx-is added before the property, indicating that this property belongs to the private property of the browser. Of course, most of these properties come from css3, this method may be used only after the browser is upgraded.

Support for CSS style important and * in IE, Firefox, opera, and Safari
1. Both IE6 and IE7 support *, but IE8 finally returned to the orthodox system and gave up *'s support.
2. Important is supported in IE7, IE8, Firefox, opera, and safari.
The priority of important is high. Example:
<Style type = "text/CSS">
Body
{
Background-color: # ff0000! Important;
* Background-color: #00ff00! Important;
* Background-color: # 0000ff;
Background-color: #000000;
}
</Style>
IE6 selects the last one, that is, background-color: #000000; (because IE6 does not support important)
IE7 selects the second one, that is, background-color: #00ff00; (because IE7 started to support important, it also keeps its last version of * feelings, however, important does not play a priority role)
Select the first one for IE8, Firefox, opera, and Safari, that is, background-color: # ff0000! Important; (IE8 fully supports important and discards *'s feelings)
Additionally, the underscore "_" is added. IE6 supports underlines. IE7, IE8, Firefox, opera, and Safari do not support underscores.

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.