Small Method for compatibility between browsers in web standards

Source: Internet
Author: User

Set the box width to 300 PX. In ie5.x browser, There is a bug in explaining the box width. It thinks that PX is the total width of the box, and the content width is changed: 300-2*10-2*5 = 270px. In ie6.0, Firefox, and opera8.0, the total box1 width is 330px, which is equal to the actual total width of the box and the content width is PX. Therefore, the width can be writtenWidth: 330px; W\Idth: 300px;, Ie5.x is not parsed. In the following example, box1 is not corrected, and box2 is corrected. If you use ie5.x, you will find that the width of the two boxes is different.

 

# Box1 {Background: # eeeeee; width: 300px; Border: solid 5px #999999; padding: 10px ;}
# Box2 {Background: # eeeeee; width: 330px; w \ idth: 300px; Border: solid 5px #999999; padding: 10px ;}

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.