Tip of the day #4: overflow:hidden under IE7

I couldn’t find a solution to this problem, so after a few tests, I found it myself.

Consider this scenario: an unordered list with floating LI elements inside (i.e. you build a slider). The LI elements have position: relative applied.

In this case, if you try overflow:hidden on the UL, it won’t take effect under IE7. What you need to do is wrap the UL in a div#ul-wrap:

div#ul-wrap {
    overflow :hidden;
    position :relative;
}

Notes

  1. cmtstudio posted this