Home > Web Front-end > CSS Tutorial > The difference between _margin and margin

The difference between _margin and margin

巴扎黑
Release: 2017-06-28 13:41:17
Original
1630 people have browsed it

Question:
       margin:15px 300px 0px 100px; height:72px; width:188px; float:left; The above CSS styles are due to Float:left; is used, so in IE5-IE6, its margin-left attribute is doubled. So there is incompatibility.
_margin: 15px 300px 0 50px Only by adding this sentence Solve the problem Why is this?
Answer:
_margin This can be recognized in IE6. Since IE browser does not comply with CSS standards for interpretation, there are many The place will appear normally in browsers such as FIREFOX CHROME but cannot be displayed normally in IE6. You can only use underline_ and add CSS attributes to write CSS code specifically for IE6. Generally, it is placed behind the regular code because except for IE6 Other browsers cannot recognize it. For example: margin:100px; _margin:90px; and *margin:90px; This last writing method is not recognized by other browsers that are common to IE6/IE7.
_margin is specifically for IE6. . IE6 will produce a double margin BUG for the margin of the first floating element that is the same as the floating direction. Yours is left floating, and the 100px margin is also the left margin. . So use _margin specifically for IE6. . 50PX is exactly half of the normal 100PX. . That's why it works normally ~ One way is to set the display of the floating element to inline so that IE6 will not have double margin, and you can avoid writing _margin.

The above is the detailed content of The difference between _margin and margin. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template