Home>Article>Web Front-end> How to solve overflow:auto invalid method in ie7
This article mainly introduces how to solve the overflow:auto invalid method in ie7. It has certain reference value. Now I share it with everyone. Friends in need can refer to it
Cause
When the style of the direct child element or subordinate child element of the parent element has theposition:relativeattribute, theoverflow:autoof the parent element The properties will become invalid.
Solution
It is very simple to solve this bug. Useposition:relative;in the parent element to solve the bug.
Code bug recurrence
ul{overflow:auto; height:100px;} li{position:relative; height:30px; line-height:30px;}
There will be a strange bug in ie7, a scroll bar appears, but the scroll cannot be pulled strip. The solution is toul{position:relative;}
IE7 float:right will wrap
I thought it would only appear in ie6 , I didn’t expect that IE7 also has this bug. Many people on the Internet said that the element of float:rightshould be placed at the front. This is such a bad idea. Sacrifice the position of an element to solve this bug. Sometimes you are a little speechless when you look at the code.The solution is to add a relative positioning to the parent layer, and then add an absolute positioning to the right side to achieve. I think this is more reliable.
The above is the entire content of this article. I hope it will be helpful to everyone's study. For more related content, please pay attention to the PHP Chinese website!
Related recommendations:
About CSS writing standard order and naming rules
The above is the detailed content of How to solve overflow:auto invalid method in ie7. For more information, please follow other related articles on the PHP Chinese website!