Get the App
SLTechnology News&Howtos  ›  Development  › 

The solution to the problem of Web Page layout CSS that IE is not compatible with FF

Shulou Source: shulou.com Published: 2022-06-02 13:41:58 11月26日 Update

Today, I will talk to you about the solution to the problem of incompatible web layout CSS between IE and FF, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

To give you a brief introduction to the solution to the CSS problem of incompatible web layout between IE and FF, including using important to solve the layout difference between IE and Mozilla, the method of displaying the content in Li by ellipsis after exceeding the length, and so on.

IE is not compatible with FF page layout CSS problem

There are often a lot of incompatibility problems between IE and FF in CSS page layout. Here are some common possibilities and solutions!

1. Use! important to solve the layout difference between IE and Mozilla

! important is a syntax defined by CSS1 to increase the priority of the application of specified style rules. The most important point is that IE has never supported this syntax, while other browsers do. So we can use this to define different styles for IE and other browsers.

For example, we define a style like this:

.colortest {border:20pxsolid#60A179! important;border:20pxsolid#00F;padding:30px;width:300px;}

When browsing in Mozilla, you can understand the priority of! important, so the color of # 60A179 is displayed; when browsing in IE, you cannot understand the priority of! important, so the color of # 00F is displayed.

2. Solve the problem that hover style does not display after hyperlink access

Change the order of the CSS attributes: the priority criteria should be:

A:link-a:visited-a:hover-a:active

3. The method of displaying the content in Li with ellipsis when it exceeds the length

CSSWebDesign I love the CSS-Web Standardization web Standard FAQ

4. Abbreviations for dimensions defined by margin and padding

Margin:3px-- means that all edges are 3px

Margin:3px5px-- means that the value of top and bottom is 3pxMagne right and the value of left is 5px

Margin:3px5px7px-- says the value of top is 3, and the value of left is 5, and the value of bottom is 7.

The four values of margin:3px5px7px5px-- represent the upper right, lower left and lower left of top,right,bottom,left; in turn.

5. Solve the problem that IE cannot correctly display the code added in transparent PNG--header

FunctioncorrectPNG () {for (vari=0;i

Tags: Content layout method problem web page style support browsing standard order different code priority difference common time browser ellipsis syntax length Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Technology Xiaomi Docker vpn