I'm using some flex box attributes to place a simple div to the center of the screen :
//CSS
html {
width: 100%;
height: 100%;
}
body {
width: 100%;
height: 100%;
margin: 0px;
display: flex;
align-items: center;
justify-content: center;
}
div {
height: 500px;
width: 500px;
background-color: red;
border: 5px solid black;
}
//HTML
<div></div>
It's working perfect but when I reduce the height of my screen to a size smaller than my div (smaller than 500px), I end up with a weird truncation : I can scroll down and see the bottom border but for some reason when I scroll up I can't reach the top border, it's hidden.
Am I missing something ? Anyone knows how to fix this ? I created a codepen to demonstrate the issue : https://codepen.io/stepinsight/full/MqmEME
Thanks heaps for your help !