На ноутбуке не прокручивается веб-страница
На мониторе 24 дюйма вся страница помещается целиком, на ноутбуке 15 дюймов 1366х768 не прокручивается вниз. Как исправить?
.container-global {
background: url("https://www.desktopbackground.org/download/o/2013/05/19/578484_mountain-lake-wallpapers_1366x768_h.jpg") center center no-repeat;
background-size: cover;
height: 100vh;
overflow: hidden;
}
.container-global::after {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, .73);
}
.container {
position: relative;
width: 1059px;
margin: 0 auto;
z-index: 1;
font-family: AdobeInvisFont, Courier, Verdana, sans-serif;
font-size: 24px;
color: rgba(255, 255, 255, 255);
}
.header {
margin-top: 141px;
}
.logo-float {
float: left;
}
.logo-float::after {
content: "";
display: block;
clear: both;
}
.email-phone {
position: relative;
float: right;
line-height: 1.25;
}
.logo {
float: left;
margin-right: 15px;
}
.logo-text {
float: right;
text-transform: uppercase;
font-weight: 700;
}
.logo-text span:first-child {
font-size: 26px;
}
.logo-text span:last-child {
font-size: 16px;
}
.email-phone span:last-child {
position: absolute;
right: 0;
}
.header-float::after {
content: "";
display: block;
clear: both;
}
.tours-float-1 {
position: relative;
margin-top: 48px;
}
.card-1, .card-2, .card-3, .card-4, .card-5, .card-6 {
float: left;
}
.desc {
margin-top: 22px;
text-align: center;
}
.tours-float-2 {
position: relative;
margin-top: 58px;
}
.tours-float-1::after, .tours-float-2::after {
content: "";
display: block;
clear: both;
}
.card-1, .card-4 {
margin-right: 34px;
}
.card-2, .card-5 {
margin: 0 34px 0 34px;
}
.card-3, .card-6 {
margin-left: 34px;
}
.footer {
margin: 61px 0 20px 0;
font-size: 16px;
text-align: center;
}
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel="stylesheet" href="css/style.css">
<title>Title</title>
</head>
<body>
<div class="container-global">
<header class="header">
<div class="container">
<div class="header-float">
<div class="logo-float">
<div class="logo"><img src="http://www.wowpinoy.ca/_icon/insurance.png" alt="Logo"></div>
<div class="logo-text"><span>Lorem</span><br><span>Ipsum</span></div>
</div>
<div class="email-phone"><span>[email protected]</span><br><span>+39 338 709 0880</span></div>
</div>
</div>
</header>
<main class="tours">
<div class="container">
<div class="tours-float-1">
<div class="card-1">
<div class="img-box"><img src="https://avto-tourizm.ru/wp-content/uploads/2013/12/bitmap_6.png" alt="Shopping Tours"></div>
<div class="desc"><span>Shopping Tours</span></div></div>
<div class="card-2">
<div class="img-box"><img src="https://avto-tourizm.ru/wp-content/uploads/2013/12/bitmap_6.png" alt="Sightseeing Tours"></div>
<div class="desc"><span>Sightseeing Tours</span></div></div>
<div class="card-3">
<div class="img-box"><img src="https://avto-tourizm.ru/wp-content/uploads/2013/12/bitmap_6.png" alt="Food Tours"></div>
<div class="desc"><span>Food Tours</span></div></div>
</div>
<div class="tours-float-2">
<div class="card-4">
<div class="img-box"><img src="https://avto-tourizm.ru/wp-content/uploads/2013/12/bitmap_6.png" alt="Bars & Nightlife"></div>
<div class="desc"><span>Bars & Nightlife</span></div></div>
<div class="card-5">
<div class="img-box"><img src="https://avto-tourizm.ru/wp-content/uploads/2013/12/bitmap_6.png" alt="Art & Architecture"></div>
<div class="desc"><span>Art & Architecture</span></div></div>
<div class="card-6">
<div class="img-box"><img src="https://avto-tourizm.ru/wp-content/uploads/2013/12/bitmap_6.png" alt="Walking Tours"></div>
<div class="desc"><span>Walking Tours</span></div></div>
</div>
</div>
</main>
<footer class="footer">
<div class="container">
<div class="copyright">© 2018 Copyright Milan Holidays, Inc. All rights reserved.</div>
</div>
</footer>
</div>
</body>
</html>
Ответы (1 шт):
Автор решения: MaximLensky
→ Ссылка
Это пример на flex :
* {
box-sizing: border-box;
list-style: none;
text-decoration: none;
}
html,
body {
margin: 0;
padding: 0;
font-size: 20px;
font-family: sans-serif;
}
.wrapper {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
width: 100%;
height: 100vh;
background: url(https://www.desktopbackground.org/download/o/2013/05/19/578484_mountain-lake-wallpapers_1366x768_h.jpg);
background-size: 100% 100%;
background-repeat: no-repeat;
color: #fff;
padding-bottom: 30px;
}
.container {
max-width: 1024px;
width: 100%;
}
.flex {
display: flex;
justify-content: space-between;
}
.desc {
text-align: center;
}
img {
display: block;
width: 100%;
height: 100%;
margin-bottom: 30px;
}
.footer {
text-align: center;
}
<div class="wrapper">
<div class="container">
<div class="flex">
<div class="item">
lorem <br> ipsum
</div>
<div class="item">
[email protected]<br> +39 338 709 0880
</div>
</div>
</div>
<div class="container">
<div class="flex">
<div class="item">
<img src="http://placehold.it/200x140" alt="">
<div class="desc">какое то описание</div>
</div>
<div class="item">
<img src="http://placehold.it/200x140" alt="">
<div class="desc">какое то описание</div>
</div>
<div class="item">
<img src="http://placehold.it/200x140" alt="">
<div class="desc">какое то описание</div>
</div>
</div>
</div>
<div class="container">
<div class="flex">
<div class="item">
<img src="http://placehold.it/200x140" alt="">
<div class="desc">какое то описание</div>
</div>
<div class="item">
<img src="http://placehold.it/200x140" alt="">
<div class="desc">какое то описание</div>
</div>
<div class="item">
<img src="http://placehold.it/200x140" alt="">
<div class="desc">какое то описание</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
all right reserved <a href="#">powered by lensky</a>
</p>
</div>
Это переделанный пример на float:
.clear,
.clear:after {
content: "";
display: block;
clear: both;
}
* {
box-sizing: border-box;
list-style: none;
text-decoration: none;
}
html,
body {
margin: 0;
padding: 0;
font-size: 20px;
font-family: sans-serif;
}
.parent {
position: relative;
width: 100%;
min-height: 100vh;
background: url(https://www.desktopbackground.org/download/o/2013/05/19/578484_mountain-lake-wallpapers_1366x768_h.jpg);
background-size: 100% 100%;
color: #fff;
}
.wrapper {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
}
.container {
max-width: 980px;
margin: auto;
text-align: center;
}
.right,
.left,
.center {
text-align: center;
display: inline-block;
}
.left {
float: left;
}
.right {
float: right;
}
.center {
margin: auto;
}
.footer {
text-align: center;
}
.one {
padding: 20px 0;
}
<div class="parent">
<div class="wrapper">
<div class="container clear one">
<div class="left">
lorem <br> ipsum
</div>
<div class="right">
[email protected] <br> +39 338 709 0880
</div>
</div>
<div class="container clear">
<div class="left">
<img src="http://placehold.it/200" alt="">
<p>lorem ipsum</p>
</div>
<div class="right">
<img src="http://placehold.it/200" alt="">
<p>lore ipsum</p>
</div>
<div class="center">
<img src="http://placehold.it/200" alt="">
<p>lorem ipsum</p>
</div>
</div>
<div class="container clear">
<div class="left">
<img src="http://placehold.it/200" alt="">
<p>lorem ipsum</p>
</div>
<div class="right">
<img src="http://placehold.it/200" alt="">
<p>lore ipsum</p>
</div>
<div class="center">
<img src="http://placehold.it/200" alt="">
<p>lorem ipsum</p>
</div>
</div>
</div>
</div>
<div class="footer">
<p>all right reserved <a href="#">powered by author</a> </p>
</div>
Хотя и там и там при правильном применении ни каких косяков не происходит
Оба примера смотреть на полный экран так как не писал медиа запросы
Адаптивный пример на трёх колоночного макета наfloat :
.clear,
.clear:after {
content: "";
display: block;
clear: both;
}
.container {
text-align: center;
max-width: 980px;
width: 100%;
margin: auto;
text-align: center;
padding: 50px 0;
}
.left {
float: left;
}
.right {
float: right;
}
.center {
display: inline-block;
width: calc(100% - 30%);
}
.footer {
text-align: center;
}
.left a {
display: block;
margin: 6px 0;
text-align-last: left;
}
@media (max-width: 880px) {
.center {
display: inline-block;
width: calc(100% - 50%);
font-size: 14px;
}
}
@media (max-width: 645px) {
.center {
display: inline-block;
width: calc(100% - 60%);
margin-top: -10px;
font-size: 14px;
}
}
@media (max-width: 445px) {
.center {
display: inline-block;
width: calc(100% - 70%);
margin-top: -10px;
font-size: 14px;
}
}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<div class="wrapper">
<div class="container clear">
<div class="left">
<a href="#">home</a>
<a href="#">about</a>
<a href="#">portfolio</a>
<a href="#">work</a>
<a href="#">mail</a>
</div>
<div class="right">
<img src="http://placehold.it/200x300" alt="">
</div>
<div class="center">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cum non perferendis vel nemo placeat officiis. Et magni illum repellat doloremque laudantium illo laboriosam? Minima veniam, quod et maiores magnam ut!
</p>
</div>
</div>
<div class="footer">
<p>
all right reserved <a href="#">creaded by Stidio Lensky</a>
</p>
</div>
</div>