smith.james0 Posted February 1, 2014 Share Posted February 1, 2014 I can not get over flow hidden to work, can anyone point out my error? http://jsfiddle.net/N9c25/ James Quote Link to comment https://forums.phpfreaks.com/topic/285870-overflow-hidden-not-working/ Share on other sites More sharing options...
Solution Strider64 Posted February 1, 2014 Solution Share Posted February 1, 2014 Using position:relative; should do the trick: #scontainer { position: relative; overflow:hidden; height:300px; border-style:solid; border-color:red; } Quote Link to comment https://forums.phpfreaks.com/topic/285870-overflow-hidden-not-working/#findComment-1467384 Share on other sites More sharing options...
kicken Posted February 1, 2014 Share Posted February 1, 2014 The reason why is because setting an item to position: absolute; removes it from the flow, so your sun is no longer considered to be a child of your container. It gets put into the flow of the nearest positioned element, or the body if no other. By making your container position: relative; it becomes the nearest positioned element and so the sun continues to be a child of it and the overflow works properly. Quote Link to comment https://forums.phpfreaks.com/topic/285870-overflow-hidden-not-working/#findComment-1467385 Share on other sites More sharing options...
smith.james0 Posted February 2, 2014 Author Share Posted February 2, 2014 Thanks for the reply Quote Link to comment https://forums.phpfreaks.com/topic/285870-overflow-hidden-not-working/#findComment-1467432 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.