While experimenting with jsfiddle, I stumbled upon an interesting issue.
Note: Run the snippet in full-screen mode (it's not responsive yet).
$('.box').click(function () {
$('.box').toggleClass("init");
});
html {
margin:0;
padding:0;
height:100vh;
background:#222;
color: cornflowerblue;
overflow-x:hidden;
font-size:18px;
}
... (CSS code continues)
... (HTML code snippet continues)
The main issue lies with the overflow property that is set on the parent 'box' div - it does not contain the 'minibox' divs even though the overflow is set to hidden on the parent element.
This problem arises from:
.minibox {
height:48%;
width:48%;
position:absolute;
background:gray;
transition:all 0.8s; <- this declaration
}
By removing this line, the issue resolves (although without the smooth transition effect intended). However, the reason behind this behavior remains unclear to me.
Upon hover, the elements initially appear as squares for a brief moment before transitioning into circles as expected.
Any suggestions on how to address this overflow issue?