I have successfully centered elements, but now I am trying to center the entire page (i.e. have the horizontal scrollbar in the middle) when zooming in. Currently, the scrollbar stays at the very left end as I zoom in.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
width: 100%;
height: 100%;
margin: 0 auto;
}
#p {
width: 100%;
display: flex;
justify-content: space-around;
align-items: center;
}
.c1,
.c2,
.c3 {
margin: 1rem;
min-width: 15rem;
height: 5rem;
text-align: center;
}
.c1 {
background-color: red;
}
.c2 {
background-color: green;
}
.c3 {
background-color: blue;
}
<div id="p">
<div class="c1">
aaa
</div>
<div class="c2">
bbb
</div>
<div class="c3">
ccc
</div>
</div>
During zooming, the red div
will go out of view and become unreachable at a certain level of zoom.