When scrolling up, the browser window disappears even though the content is centered in the middle. This behavior is unexpected as centering content should not cause the browser window to disappear when scrolling up on a mobile phone.
When I scroll up the browser window disappears.
Even though this is centered in the middle.
How do I fix that?
Viewed in debug mode inside codepen I am seeing a scroll bar.
Right and bottom.
https://jsfiddle.net/px5ahsy4/1/
You can see right and bottom scroll bars:
html,
body {
margin: 0;
padding: 0;
}
body {
background: #121212;
padding: 0 8px 0;
}
.outer-containerB {
display: flex;
min-height: 100vh;
}
.containerB,
.containerC {
margin: auto;
}
.containerC {
background: none;
/*
teal */
}
.flex {
display: flex;
flex-direction: column;
align-items: center;
background: none;
}
.blue-margin-bottom {
margin-bottom: 16px;
background: none;
}
.orange-margin {
margin-left: 12px;
margin-right: 12px;
background: none;
}
.title-text {
margin: 0;
color: #0059dd;
font-size: 20px;
line-height: 1.5;
text-overflow: ellipsis;
max-width: 100%;
white-space: nowrap;
overflow: hidden;
font-family: "Karla", sans-serif;
font-weight: 700;
font-style: normal;
}
.yellow-padding-margin {
margin-top: 4px;
padding-left: 40px;
padding-right: 40px;
background: none;
}
.center-text {
padding: 0;
margin: 0;
text-align: center;
color: #0059dd;
font-size: 16px;
line-height: 1.5;
overflow-wrap: normal;
font-family: "Karla", sans-serif;
font-weight: 500;
font-style: normal;
background: none;
}
.exitE {
position: relative;
margin: 6px auto 0;
inset: 0 0 0 0;
width: 47px;
height: 47px;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
background: black;
border-radius: 50%;
border: 5px solid #0059dd;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.exitE::before,
.exitE::after {
content: "";
position: absolute;
width: 100%;
height: 5px;
background: #0059dd;
transform: rotate(45deg);
}
.exitE::after {
transform: rotate(-45deg);
}
.my-footer {
box-sizing: border-box;
border-top: 1px solid #1155cc;
background: #121212;
text-align: center;
word-wrap: break-word;
padding: 22px 8px 0;
font-family: Verdana, Arial, sans-serif;
font-size: 13.33px;
line-height: 1.5;
vertical-align: baseline;
margin-top: auto;
}
.margin-top {
margin-top: 10px;
}
.my-footer a {
text-decoration: none;
}
.divider::before,
.divider::after {
content: "";
position: relative;
top: 4px;
margin: 0 7.4px;
border: none;
height: 12px;
border-left: 1px solid #f6b26b;
}
.footer-top {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin: 0 0 13px;
padding: 0;
list-style: none;
}
.footer-top li {
display: flex;
}
.footer-top a {
color: #0059dd;
font-weight: 700;
}
.my-footer .green-text {
color: #38761d;
font-weight: 400;
}
.orange-text {
color: #b45f06;
font-weight: 700;
}
.footer-mid {
margin-bottom: 49px;
color: #0059dd;
font-family: Arial, sans-serif;
font-size: 24px;
font-weight: 700;
}
.footer-base {
color: #0059dd;
padding: 0;
}
html:
<div class="outer-containerB hide">
<div class="containerC hide">
<div class="inner-container ">
<div class="flex">
<div class="blue-margin-bottom">
<svg width="136" height="136" viewBox="0 0 136 136">
<rect x="0" y="0" width="136" height="136" fill="#0059dd" />
<rect x="4" y="4" width="128" height="128" fill="black" />
<rect x="8" y="8" width="120" height="120" fill="#0059dd" />
<rect x="12" y="12" width="112" height="112" fill="black" />
<rect x="16" y="16" width="104" height="104" fill="#0059dd" />
<rect x="20" y="20" width="96" height="96" fill="black" />
<rect x="24" y="24" width="88" height="88" fill="#0059dd" />
<rect x="28" y="28" width="80" height="80" fill="black" />
<rect x="32" y="32" width="72" height="72" fill="#0059dd" />
<rect x="36" y="36" width="64" height="64" fill="black" />
<rect x="40" y="40" width="56" height="56" fill="#0059dd" />
<rect x="44" y="44" width="48" height="48" fill="black" />
<rect x="48" y="48" width="40" height="40" fill="#0059dd" />
<rect x="52" y="52" width="32" height="32" fill="black" />
<rect x="56" y="56" width="24" height="24" fill="#0059dd" />
<rect x="60" y="60" width="16" height="16" fill="black" />
<rect x="64" y="64" width="8" height="8" fill="#0059dd" />
</svg>
</div>
<div class="orange-margin">
<h1 class="title-text">text</h1>
</div>
<div class="yellow-padding-margin">
<h2 class="center-text">text</h2>
</div>
</div>
<button class="exitE" type="button" title="Exit" aria-label="Exit"></button>
<footer class="margin-top my-footer">
<ul class="footer-top">
<li><a href="#" target="_blank">text</a></li>
<li class="divider"><a href="#" target="_blank">text</a></li>
<li><a href="#"
target="_blank"><span class="green-text">text</span><span class="orange-text">text</span></a>
</li>
</ul>
<div class="footer-mid">text</div>
<div class="footer-base">text</div>
</footer>
</div>
</div>
</div>