Вертикальный скролл на IOS
Я делаю небольшой тестовый вебсайт. Прикол в том, что гугл хром показывает, что все нормально, однако на телефоне (iphone 6s) есть раздражающий вертикальный скролл, хотя контент целиком и полностью помещается на странице. Есть еще xiaomi, там нормально, но у него немного экран больше, возможно из за этого. Но там свой баг, почему размер кнопок отличается и они выстраиваются в 2 ряда. Уже нервным стал, как делать отладку, если непонятно как оно будет выглядеть в реале?
P.S. Убрав height: 100vh у .section, скролл пропадает, но и верстка ломается.
var str = '<h1>Привет!<br> Я Имя,<br> web разработчик </h1>',
i = 0,
isTag,
text;
(function type() {
text = str.slice(0, ++i);
if (text === str) return;
document.getElementById('index-title-main').innerHTML = text;
var char = text.slice(-1);
if( char === '<' ) isTag = true;
if( char === '>' ) isTag = false;
if (isTag) return type();
setTimeout(type, 80);
}());
*{
margin: 0;
padding: 0;
}
body{
max-height: 100vh;
margin-left: 145px;
background-color: #1D1D1D;
}
.section{
position: relative;
padding: 90px 30px;
width: 100%;
height: 100vh;
}
#canvas{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: -1;
}
.text-area{
position: absolute;
top: 50%;
-ms-transform: translateY(-50%);
transform: translateY(-50%);
padding: 0 0 0 75px;
z-index: 4;
}
#index-title-main{
color: #fff;
font-size: 55px;
height: 290px;
}
.index-form-link{
display: block;
width: 245px;
margin-top: 50px;
padding: 10px;
color: #35E6BA;
font-size: 25px;
text-align: center;
font-weight: bold;
border-radius: 5px;
text-decoration: none;
border: 1px solid #35E6BA;
-webkit-animation: fadein 5s;
-moz-animation: fadein 5s;
-ms-animation: fadein 5s;
-o-animation: fadein 5s;
animation: fadein 5s;
}
.index-form-link:hover{
background-color: #35E6BA;
color: #000;
font-weight: bold;
}
.index-img-content-link{
position: absolute;
right: 50px;
top: 15%;
}
.index-img-content{
width: 150px;
height: auto;
-webkit-animation: fadein 5s, rotation 3s infinite linear;
-moz-animation: fadein 5s, rotation 3s infinite linear;
-ms-animation: fadein 5s, rotation 3s infinite linear;
-o-animation: fadein 5s, rotation 3s infinite linear;
animation: fadein 5s, rotation 3s infinite linear;
}
.index-backdev{
color: #555;
font-size: 24px;
margin-top: 20px;
margin-bottom: 20px;
-webkit-animation: fadein 5s;
-moz-animation: fadein 5s;
-ms-animation: fadein 5s;
-o-animation: fadein 5s;
animation: fadein 5s;
}
@media only screen and (max-width: 1000px){
body{
margin-left: 0;
}
.text-area{
padding: 0 50px;
}
.index-img-content{
width: 125px;
}
.index-form-link{
font-size: 18px;
width: 200px;
}
.index-img-content-link{
top: 25%;
}
}
@media (orientation: portrait) {
@media only screen and (max-width: 780px){
#index-title-main{
font-size: 45px;
height: 235px;
}
.index-img-content-link{
top: 30%;
}
}
@media only screen and (max-width: 650px){
.text-area{
padding-left: 15px;
}
#index-title-main{
font-size: 40px;
height: 210px;
}
.index-img-content{
width: 100px;
}
}
@media only screen and (max-width: 570px){
#index-title-main{
font-size: 35px;
height: 180px;
}
.index-img-content-link{
top: 32.5%;
}
.text-area{
padding-right: 15px;
}
}
@media only screen and (max-width: 480px){
.section{
padding-left: 15px;
padding-right: 15px;
}
#index-title-main{
font-size: 30px;
height: 160px;
}
.index-img-content-link{
top: 35%;
right: 15px;
}
.index-img-content{
width: 90px;
}
.index-backdev{
font-size: 18px;
}
.index-form-link{
font-size: 15px;
width: 165px;
padding: 7px;
}
}
@media only screen and (max-width: 400px){
#index-title-main{
font-size: 25px;
height: 130px;
}
.index-img-content{
width: 75px;
}
}
@media only screen and (max-width: 350px){
.text-area{
padding-left: 0;
padding-right: 0;
}
/* #index-title-main{
font-size: 25px;
height: 130px;
} */
}
@media only screen and (max-width: 320px){
#index-title-main{
font-size: 20px;
height: 105px;
}
.index-img-content{
width: 65px;
}
}
@media only screen and (max-height: 900px){
.index-img-content-link{
top: 32.5%;
}
}
@media only screen and (max-height: 730px){
.index-img-content-link{
top: 30%;
}
}
@media only screen and (max-height: 650px){
.index-img-content-link{
top: 27.5%;
}
}
@media only screen and (max-height: 570px){
.index-img-content-link{
top: 25%;
}
}
@media only screen and (max-height: 500px){
.index-img-content-link{
top: 22.5%;
}
}
@media only screen and (max-height: 450px){
.index-img-content-link{
top: 20%;
}
.index-backdev{
margin: 10px 0;
}
.index-form-link{
margin-top: 12.5px;
}
}
@media only screen and (max-height: 330px){
.index-img-content-link, .index-img-content{
display: none;
}
}
}
@media (orientation: landscape){
@media only screen and (max-width: 1000px),
only screen and (max-height: 380px){
.index-img-content-link{
top: 10%;
}
.text-area{
padding-left: 75px;
}
.index-backdev{
margin: 10px 0;
}
.index-form-link{
margin-top: 25px;
}
}
@media only screen and (max-width: 800px),
only screen and (max-height: 480px){
#index-title-main{
font-size: 40px;
height: 210px;
}
.index-img-content{
width: 100px;
}
}
@media only screen and (max-width: 650px){
.text-area{
padding-left: 25px;
padding-right: 25px;
}
#index-title-main{
font-size: 35px;
height: 180px;
}
}
@media only screen and (max-width: 490px){
/* .index-form-link{
margin-top: 25px;
} */
#index-title-main{
font-size: 30px;
height: 160px;
}
.index-img-content{
width: 85px;
}
}
@media only screen and (max-width: 430px){
#index-title-main{
font-size: 25px;
height: 130px;
}
.section{
padding-left: 10px;
padding-right: 10px;
}
.text-area{
padding-left: 10px;
padding-left: 10px;
}
}
@media only screen and (max-width: 340px){
#index-title-main{
font-size: 20px;
height: 105px;
}
.index-img-content{
width: 70px;
}
}
@media only screen and (max-height: 400px){
#index-title-main{
font-size: 30px;
height: 160px;
}
}
}
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
#index-title-main{
font-size: 40px;
height: 280px;
}
}
@keyframes rotation {
from {
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}
to {
-moz-transform: rotate(360deg);
-o-transform: rotate(360deg);
-webkit-transform: rotate(360deg);
-ms-transform: rotate(0deg);
transform: rotate(360deg);
}
}
@keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
@-moz-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
@-webkit-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
@-ms-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="css/index.css">
<title>Портфолио</title>
</head>
<body>
<section class="section">
<canvas id="canvas"></canvas>
<div class="text-area">
<div id="index-title-main"></div>
<h5 class="index-backdev">Back End Developer</h5>
<a class="index-form-link" href="">Свяжитесь со мной</a>
</div>
<a class="index-img-content-link" href="/works.html"><img class="index-img-content" src="img/t-index.png" alt=""></a>
</section>
</body>
</html>