What if the CSS Padding effect is different between FF and IE
This article will explain in detail how to do different CSS Padding effects under FF and IE. Xiaobian thinks it is quite practical, so share it with you as a reference. I hope you can gain something after reading this article.
How to solve CSS Padding effect difference between Firefox and IE
CSS padding properties
The CSS padding property defines the padding of the element. The padding property accepts either a length value or a percentage value, but negative values are not allowed.
For example, if you want all h2 elements to have padding of 10 pixels on each side, just do this:
h2{padding:10px;} You can also set the padding for each side separately in order of top, right, bottom, and left, and each side can have different units or percentage values:
h2{padding:10px0.25em2ex20%;}
Question:
test
The above code will have different effects in IE and Firefox. The main reason is that Firefox interprets padding-top differently from IE
Firefox to DIV total height is padding-top+height, and IE,padding-top is included in the height, to solve this contradiction, you can use! important
padding-top:5px; height:10px ! important; height:15px; About "FF and IE CSS Padding effect is different how to do" This article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it to let more people see.