Get the App
SLTechnology News&Howtos  ›  Development  › 

What if overflow:auto is invalid in ie7

Shulou Source: shulou.com Published: 2022-06-03 20:17:41 11月11日 Update

This article mainly introduces how to do overflow:auto invalid in ie7. The introduction in this article is very detailed and has certain reference value. Interested friends must read it!

causes

When a parent element's immediate child element or child element's style has a position:relative attribute, the parent element's overflow:auto attribute is invalidated.

solutions

This bug can be easily fixed by using position:relative; in the parent element.

Code bug recurrence

I am a very hard front-end blog, I hope you will like me a very hard front-end blog, I hope you will like me a very hard front-end blog, I hope you will like me a very hard front-end blog, I hope you will like me a very hard front-end blog, I hope you will like ul{overflow:auto; height:100px;}li{position:relative; height:30px; line-height:30px;}

In ie7 there is a strange bug where the scroll bar appears, but you can't pull it. The solution is to give ul{position:relative;}

IE7 float:right will wrap

I thought it would only appear in ie6 before, but I didn't expect ie7 to have this bug as well. Many people on the Internet said that the float:right element was placed at the top. This is how 2 ideas ah. Sacrificing the position of an element to solve this bug, sometimes you look at the code yourself a little speechless, the solution can be to add a relative position to the parent layer, and then add an absolute position to the right of this to achieve. I think it's more reliable this way.

The above is "overflow:auto invalid in ie7 how to do" all the content of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

Tags: Elements front end blog what to do code content attributes articles positioning unexpected subordinates values locations interests methods reasons right guys buddies that is Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Shulou Tech Info Apple Linux Docker