Discussion of browser compatibility

Source: Internet
Author: User
Tags min

Browser compatibility refers to different browsers (Ie,firefox,chrome ...). The display may be inconsistent and result in compatibility issues between browsers and Web pages. At present, there is no unified tool to solve this problem, for front-end developers, browser compatibility is undoubtedly the development process can not be evaded is also a very cumbersome steps, then when faced with such a problem, what are the tips?

(1) The recognition of height by different browsers. All browsers general: Height:100px;ie6 Special: _height:100px; *HEIGHT:100PX;IE7 Special: *+height:100px;

(2) different browsers default internal and external margins are different. To solve this problem, we can set the *{padding:0;margin:0 in the stylesheet, and the outer margin of zero makes the browser uniform so that there is no problem with the internal and external margins that may occur in different browsers.

(3) Firefox under the div set padding will cause a corresponding increase in width and height, but IE will not. This can be solved with!important, because the IE6 browser does not recognize the!important property, so CSS can be set width:100px!important;width:120px;padding:0 10px;

(4) The question of double margin. Set float div in IE set the margin will double, this is actually an IE bug. If this problem occurs we can set the div display:inline, so IE will not show double problem. <BR/> Block and inline two elements: block element is characterized by a full line, that is, the next element will wrap, but the height, width, row height, margin can be controlled (blocks); inline elements are not filled with one row and other elements on the same line, Not controllable (inline element);

(5) Minimum width and height of the problem. IE does not recognize the definition of min-, in IE will width,height as a min-width,min-height to use, if only in the style defined min-width,min-height words, This can not be recognized in IE, so there is no width and height. So you can set width and height automatically when setting the minimum width and height.

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.