Проблема с видимостью кнопки в мобильных браузерах
* {
box-sizing: border-box;
}
body,
html {
margin: 0;
padding: 0;
overflow: hidden;
}
#output {
width: 100vw;
height: 50vh;
padding: 10px;
resize: none;
}
#input_form {
width: 100vw;
padding: 0;
margin: 0;
line-height: 0;
border: 0;
}
#input {
border: 1px solid #aaa;
border-radius: 0%;
height: calc(50vh - 52px);
width: calc(100vw);
line-height: 1.5;
outline: 0;
word-break: break-all;
white-space: pre-wrap;
resize: none;
}
#run-btn {
display: block;
width: 100vw;
height: 50px;
background-color: #aaa;
border: 0;
cursor: pointer;
margin: 0;
padding: 0;
}
#loader_layer {
display: none;
justify-content: center;
align-items: center;
height: calc(100vh - 35px);
width: 100vw;
height: 100vh;
position: absolute;
top: 0;
left: 0;
z-index: 999;
background-color: #fff;
}
#loader {
width: 35px;
height: 35px;
border: 5px solid rgba(189, 189, 189, 0.25);
border-left-color: rgba(3, 155, 229, 1);
border-top-color: rgba(3, 155, 229, 1);
border-radius: 50%;
display: block;
animation: rotate_loader 600ms infinite linear;
}
@keyframes rotate_loader {
to {
transform: rotate(1turn)
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<div id=output>
</div>
<form id=input_form action="/api" method=post enctype='multipart/form-data'>
<textarea placeholder="Your code here..." id=input name=code></textarea>
<input type=submit id=run-btn value=Run />
</form>
<div id="loader_layer">
<div id="loader"></div>
</div>
</body>
</html>
Почему на мобильных браузерах (в частности Chrome и Opera) не отображается снизу серая кнопка с надписью "Run" (селектор кнопки: #run-btn)?
В браузере телеграма и десктопных браузерах - всё как надо. А в мобильных кнопка видимо уходит за область просмотра вниз.
Должно быть, как на картинке:
Ответы (2 шт):
Автор решения: Roman C
→ Ссылка
* {
box-sizing: border-box;
}
body,
html {
margin: 0;
padding: 0;
overflow: hidden;
}
#output {
width: 100vw;
height: 50vh;
padding: 10px;
resize: none;
}
#input_form {
width: 100vw;
padding: 0;
margin: 0;
line-height: 0;
border: 0;
}
#input {
border: 1px solid #aaa;
border-radius: 0%;
height: calc(50vh - 52px);
width: calc(100vw);
line-height: 1.5;
outline: 0;
word-break: break-all;
white-space: pre-wrap;
resize: none;
}
#run-btn {
display: block;
width: 100vw;
height: 50px;
background-color: #aaa;
border: 0;
cursor: pointer;
margin: 0;
padding: 0;
}
#loader_layer {
display: none;
justify-content: center;
align-items: center;
height: calc(100vh - 35px);
width: 100vw;
height: 100vh;
position: absolute;
top: 0;
left: 0;
z-index: 999;
background-color: #fff;
}
#loader {
width: 35px;
height: 35px;
border: 5px solid rgba(189, 189, 189, 0.25);
border-left-color: rgba(3, 155, 229, 1);
border-top-color: rgba(3, 155, 229, 1);
border-radius: 50%;
display: block;
animation: rotate_loader 600ms infinite linear;
}
@keyframes rotate_loader {
to {
transform: rotate(1turn)
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1" />
</head>
<body>
<form id=input_form action="/api" method=post enctype='multipart/form-data'>
<textarea placeholder="Your code here..." id=input name=code></textarea>
<input type=submit id=run-btn value=Run />
</form>
<div id="loader_layer">
<div id="loader"></div>
</div>
<div id=output>
</div>
</body>
</html>
Автор решения: Антон
→ Ссылка
Нашёл подсказку вот здесь: https://developer.chrome.com/blog/url-bar-resizing?hl=ru
Помогло то что я форме (#input_form) добавил
position:fixed;
left:0;
bottom:0;
