Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve all kinds of difficult and complicated diseases of IE6 easily

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

How to easily solve the various problems of IE6, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

Describe to you how to solve all kinds of problems in IE6, mainly from nine aspects.

Nine steps to teach you how to solve all kinds of problems in IE6.

1. Use document types

Try to use the strictest document types and make sure your page is running in standard mode. Although with them, you may not be able to use a lot of tags, such as bforce, s, etc., but they can all be replaced by CSS.

Or, at its simplest, this is the document type approved by HTML5***, and the browser will automatically convert to the one above. Do not use xhtml documents to declare that it originally wanted to get html to become a transitional product, but did not realize that it was a passer-by in a hurry. And with it, the nodeName of an element may be case-sensitive and cumbersome.

two。 Use position:relative

In a layout, you always consider positioning the layout before you go to the floating layout. IE's floating model is crazily gripping.

3. Use display:inline

If you must use floats, follow display:inline. Because IE6 has a bug that is easy to happen. This occurs as long as the float and margin values in the same direction as float are set on the block container element. If we set float:left and margin-left:100px for the div element, it becomes margin-left:200px in IE6.

4. Please do not use comment nodes

There are two malignant things involved here. One is the extra character bug. You can refer to the article "Phantom of the Opera House bug" written by Yang Zhengyi (A Yi) in this blog park. The second is the full range of IE search API bug,document.all,document.getElementsByTagName and document.querySelectorAll are likely to return comment nodes.

5. For suspension effect, remember to use an element nesting with href attribute.

In IE:hover, only the a tag is valid, and the tag must have the href attribute explicitly set.

6. Do not use percentages in style settin

IE has a problem calculating percentages.

7. Let the element get the hasLayout

We can use el.currentStyle.hasLayout to check whether it gets layout, and one way to get layout is zoom:1.

8. Strictly abide by the nesting rules of (x) html

Nesting rules are defined in the document type, and the document is parsed according to it. Although today's browsers are eye-catching, it is better to be careful in order to prevent them from getting crazy. In addition, although some elements will close automatically, we should close ourselves. It is very important to form a good habit.

9. Improve your javascrip level

Many things in IE6 are not supported or not well supported, but almost all of them can be simulated with javascript, such as various relational pseudo-classes, sub-element filtering pseudo-classes, attribute pseudo-classes, target pseudo-classes, min-width and max-width,PNG transparency issues.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report