Isn't it important to work in IE6?

Does it work !importantin IE6? If we need compatibility with IE6, then shouldn't we use it !important?

+3
source share
1 answer

IE6 supports! important when rule s! important is the last rule for this property in the selector.

This sounds a bit confusing, but if you declare an important height, this should be the last declaration for a "height" in this selector.

As such, consider the following examples:

#selector { height: 100px; height: 150px !important; }
Result: All browsers: 150px;

#selector { height: 100px; height: 150px !important; }
td#selector { height: 200px; }
Result: All browsers: 150px;

#selector { height: 100px; height: 150px; }
td#selector { height: 70px; height: 200px !important; }
Result: All browsers: 200px;

#selector { height: 100px !important; height: 150px; }
Result: All modern browsers but ie6: 100px; ie6: 150px;

#selector { height: 100px !important; height: 150px; }
td#selector { height: 200px; }
Result: All modern browsers but ie6: 100px; ie6: 200px;

#selector { height: 100px; height: 150px; }
td#selector { height: 70px !important; height: 200px; }
Result: All modern browsers but ie6: 70px; ie6: 200px;

, ie6 , ( , , ). "" . , .

"! important" "height" , .

, "" , ie6 .

ie6, , ie6, , css ie6.

, CSS : 1) , , 2) , . , - , .

, "" , :

  • , , .

  • , - , - , - .

ie6 :

  • .

  • , - , - , - .

+6

Source: https://habr.com/ru/post/1750415/


All Articles