Jump to content


IMG is visible outside DIV

Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I'm clueless, but I can't understand why the tree image is visible outside the red container div. Only when I change the class 'tree' in the html to something random it works like I expected: the tree image is cut off from outside the red div. Only when I use 'tree' as the class name and animate it through GSAP overflow:hidden on the container div seems not to work anymore? What am I doing wrong?

See the Pen jKKdQa by anon (@anon) on CodePen

Link to comment
Share on other sites

Your parent element didn't have display and position property set. In most browsers you need to set them to make overflow hidden work.


And renaming your tree class worked because it was setting position of tree to absolute.


See the Pen rKKPEQ?editors=1010 by Sahil89 (@Sahil89) on CodePen


  • Like 4
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.