"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > Why Does `overflow: hidden` Fail to Hide Inactive Slides in IE6 and IE7 When Combined with `position: relative`?

Why Does `overflow: hidden` Fail to Hide Inactive Slides in IE6 and IE7 When Combined with `position: relative`?

Published on 2024-11-09
Browse:384

Why Does `overflow: hidden` Fail to Hide Inactive Slides in IE6 and IE7 When Combined with `position: relative`?

IE6 IE7 CSS Problem with overflow: hidden; - position: relative; Combo

This issue arises when attempting to hide inactive slides in a slider by utilizing the CSS property overflow: hidden. However, in IE 6 and 7, this approach fails, leaving non-active slides visible. The root cause lies in the combination of overflow: hidden and position: relative on the containing ul element.

A known workaround for this issue is to add position: relative to the container element. In the given HTML structure, the body tag serves as the container. To resolve the problem, add a div directly below the body and assign it position: relative.


  
...

In the provided CSS, add the following line:

#container {
  position: relative;
}

This modification will resolve the issue and enable the use of overflow: hidden to hide inactive slides in IE 6 and 7, ensuring proper slider functionality.

Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3