почему в css не работает position:fixed
Почему при адаптации меню проскроливается ?
* {
font-family: "Roboto", sans-serif;
}
header {
position: relative;
height: 50px;
width: 100%;
}
nav {
position: fixed;
width: 100%;
height: 50px;
background: #212121;
z-index: 2;
}
.menu {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
padding: 13px 70px;
margin: 0;
list-style: none;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
}
.menu_link {
text-decoration: none;
color: #ffffff;
font-size: 15px;
font-weight: 300;
}
.menu_item {
border-right: 2px dotted black;
padding-right: 45px;
}
.menu_item:last-child {
border-right: none;
}
.subheader {
height: 84px;
background-color: rgba(0, 0, 0, 0.6);
position: absolute;
top: 50px;
width: 100%;
}
.subheader_logo {
display: block;
margin-top: 16px;
max-width: 100%;
}
.subheader_official {
margin-top: 6px;
opacity: 0.5;
color: #ffffff;
font-size: 13px;
font-weight: 400;
}
.subheader_phone {
display: block;
margin-top: 8px;
color: #ffffff;
font-size: 22px;
font-weight: 400;
text-transform: uppercase;
text-align: right;
text-decoration: none;
line-height: 24px;
}
.subheader_call {
margin-top: 19px;
color: #ffffff;
font-size: 12px;
text-align: right;
font-weight: 300;
line-height: 12px;
}
.subheader_btn {
margin-top: 19px;
width: 172px;
height: 46px;
-webkit-box-shadow: inset 0 -3px rgba(0, 0, 0, 0.12);
box-shadow: inset 0 -3px rgba(0, 0, 0, 0.12);
border: 3px solid rgba(0, 0, 0, 0.07);
background-image: -webkit-gradient(linear, left bottom, left top, from(#1eacc7), to(#4ce2ff));
background-image: linear-gradient(to top, #1eacc7 0%, #4ce2ff 100%);
color: #ffffff;
font-size: 14px;
font-weight: 400;
text-transform: uppercase;
border: none;
border-radius: 4px;
}
.subheader_btn:hover {
background-image: none;
background-color: #1eacc7;
}
.promo {
min-height: 800px;
background: url(../image/bg/first_bg.png) center center/cover;
padding: 150px 0 135px 0;
}
.promo_header {
color: #ffffff;
font-size: 60px;
font-weight: 700px;
text-transform: uppercase;
line-height: 50px;
margin: 0;
text-align: center;
}
.promo_subheader {
color: #ffffff;
font-size: 36px;
font-weight: 700px;
text-transform: uppercase;
line-height: 40px;
margin: 0;
margin-top: 22px;
text-align: center;
}
.promo_descr {
color: #ffffff;
font-weight: 400;
font-size: 18px;
line-height: 24px;
text-align: center;
margin-top: 23px;
}
.promo_btn {
display: block;
margin: 118px auto 0 auto;
border: none;
border-radius: 4px;
width: 259px;
height: 63px;
-webkit-box-shadow: inset 0 -4px rgba(0, 0, 0, 0.12);
box-shadow: inset 0 -4px rgba(0, 0, 0, 0.12);
border: 3px solid rgba(0, 0, 0, 0.07);
background-image: -webkit-gradient(linear, left bottom, left top, from(#1eacc7), to(#4ce2ff));
background-image: linear-gradient(to top, #1eacc7 0%, #4ce2ff 100%);
color: #ffffff;
font-size: 18px;
font-weight: 400;
text-transform: uppercase;
}
.promo_btn:hover {
background-image: none;
background-color: #1eacc7;
}
.reason {
min-height: 900;
padding: 71px 0 65px 0;
}
.reason_item {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
margin: 35px auto;
max-width: 480px;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.reason_round {
width: 113px;
height: 113px;
border-radius: 100%;
background: #1eacc7;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin: 0 auto;
}
.reason_text {
font-weight: 300;
font-size: 15px;
line-height: 21px;
max-width: 341px;
}
.reason_subheader {
color: #1eacc7;
font-weight: 400;
font-size: 17px;
}
.title {
color: #222222;
font-weight: 700;
font-size: 38px;
text-align: center;
text-transform: uppercase;
margin-top: 36px;
}
.title_white {
color: #ffffff;
}
.label {
margin-top: 36px;
width: 112px;
height: 24px;
display: block;
margin: 0 auto;
background: #000000;
font-weight: 100;
font-size: 11px;
text-transform: uppercase;
color: #ffffff;
text-align: center;
line-height: 24px;
text-transform: uppercase;
}
.label_white {
background: #ffffff;
color: #070716;
}
.subtitle {
font-weight: 400;
font-size: 17px;
color: #222222;
text-align: center;
margin-top: 19px;
text-align: center;
}
.subtitle_white {
color: #ffffff;
}
.mobile {
min-height: 864px;
padding: 48px 0 79px 0;
background: url("../image/bg/mobile_bg.png") center center/cover no-repeat;
}
.mobile_item {
width: 320px;
height: 280px;
margin: 0 auto;
margin-bottom: 19px;
padding-top: 92px;
position: relative;
}
.mobile_item_1 {
background: url("../image/phone/1.png") center center/cover no-repeat;
}
.mobile_item_2 {
background: url("../image/phone/2.png") center center/cover no-repeat;
}
.mobile_item_3 {
background: url("../image/phone/3.png") center center/cover no-repeat;
}
.mobile_item_4 {
background: url("../image/phone/4.png") center center/cover no-repeat;
}
.mobile_item_5 {
background: url("../image/phone/5.png") center center/cover no-repeat;
}
.mobile_item_6 {
background: url("../image/phone/6.png") center center/cover no-repeat;
}
.mobile_item_subtitle {
color: #ffffff;
font-size: 24px;
font-weight: 400;
text-transform: uppercase;
text-align: center;
}
.mobile_item_plus {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 26px;
height: 26px;
border-radius: 100%;
margin: 0 auto;
background-color: #000000;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
bottom: 35px;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
cursor: pointer;
}
.mobile_item_plus:before {
content: "";
display: block;
width: 14px;
height: 2px;
background-color: #1eacc7;
-webkit-transition: 0.3s all;
transition: 0.3s all;
}
.mobile_item_plus:after {
content: "";
position: absolute;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
display: block;
height: 14px;
width: 2px;
background-color: #1eacc7;
-webkit-transition: 0.3s all;
transition: 0.3s all;
}
.mobile_item_plus:hover:before,
.mobile_item_plus:hover:after {
background-color: #ff5656;
}
.mobile .row {
margin-top: 32px;
}
.choice {
min-height: 500px;
background-color: #070716;
padding-top: 37px;
}
.uber_car {
background: url("../image/bg/mobile_bg.png") center center/cover no-repeat;
min-height: 400px;
position: relative;
padding-top: 200px;
}
.uber_car img {
display: block;
right: 50%;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
position: absolute;
top: -270px;
z-index: 1;
}
.uber_car .car_subtitle {
position: static;
text-align: center;
font-weight: 300;
font-size: 17px;
line-height: 24px;
}
.require {
padding: 68px 0 84px 0;
}
.require_block {
margin: 33px 0;
}
.require_block_nmb {
margin-bottom: 0px;
}
.require_title {
color: #1ca8c3;
font-size: 22px;
font-weight: 400;
}
.require_list {
list-style-type: none;
padding-left: 50px;
margin-top: 22px;
}
.require_list li {
position: relative;
font-size: 17px;
font-weight: 300;
line-height: 24px;
margin-bottom: 10px;
}
.require_list li:before {
content: "";
display: block;
position: absolute;
left: -32px;
top: 3px;
width: 21px;
height: 20px;
background: url("../icons/chekmark_blue.png") center center/cover no-repeat;
}
.require_descr {
margin-top: 25px;
font-size: 17px;
font-weight: 300;
line-height: 24px;
color: #1ca8c3;
}
.require .warning .require_title {
color: #ff5656;
}
.require .warning .require_list li:before {
background: url("../icons/chekmark_red.png") center center/cover no-repeat;
}
.world {
position: relative;
min-height: 717px;
padding: 49px 0;
background: url("../image/bg/map.png") center center/cover no-repeat;
}
.world_link {
position: absolute;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
bottom: 49px;
text-align: center;
font-size: 15px;
font-weight: 400;
line-height: 68px;
text-transform: uppercase;
color: #1fbad6;
}
.world_link:hover {
text-decoration: none;
color: #fff;
}
footer {
padding: 14px 23px 39px 23px;
}
footer a:hover {
text-decoration: none;
}
.footer_divider {
width: 299px;
height: 4px;
background-color: #1fbad6;
margin: 0 auto;
}
.footer_wrapper {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-box-align: start;
-ms-flex-align: start;
align-items: flex-start;
padding-top: 32px;
text-decoration: none;
}
.footer_wrapper>div {
width: 33%;
}
.footer_wrapper>div:nth-child(3) {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: end;
-ms-flex-pack: end;
justify-content: flex-end;
}
.footer_social {
width: 160px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
}
.footer_social_item {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin: 0 4px;
width: 32px;
height: 32px;
background-color: #070716;
border-radius: 100%;
text-decoration: none;
}
.footer_social_item i {
color: #fff;
}
.footer_links {
width: 390px;
margin: 0 auto;
text-decoration: none;
}
.footer_links_main {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
padding: 0 10px;
text-decoration: none;
}
.footer_links_main a {
color: #070716;
font-size: 15px;
font-weight: 300;
text-transform: uppercase;
text-decoration: none;
}
.footer_links_sub {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
margin-top: 10px;
}
.footer_links_sub a {
color: #999999;
font-size: 11px;
font-weight: 300;
text-transform: uppercase;
text-decoration: none;
}
.footer_links_lang {
display: block;
margin: 0 auto;
color: #1fbad6;
font-size: 11px;
font-weight: 400;
margin-top: 19px;
text-transform: uppercase;
text-align: center;
}
.footer_mobile img {
max-width: 125px;
}
@media (max-width: 1200px) {
.menu_item {
padding-right: 20px;
}
.menu_link {
font-size: 14px;
}
.promo_header {
font-size: 50px;
}
.reason_text {
width: 300px;
}
.mobile_item {
width: 295px;
height: 275px;
}
.mobile_item_subtitle {
font-size: 20px;
}
.footer_mobile img {
max-width: 65px;
}
.footer_links_main a {
font-size: 13px;
margin: 0 auto;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
.footer_links_sub {
font-size: 13px;
margin: 0 auto;
-webkit-transform: translateX(-10%);
transform: translateX(-10%);
}
.footer_links_lang {
font-size: 13px;
margin: 0 auto;
-webkit-transform: translateX(-10%);
transform: translateX(-10%);
}
}
@media (max-width: 991px) {
.menu_item {
padding-right: 12px;
}
.menu_link {
font-size: 10px;
}
.subheader_logo img {
width: 100%;
}
.subheader_official {
font-size: 12px;
}
.subheader_phone {
font-size: 19px;
}
.subheader_btn {
width: 159px;
height: 42px;
}
.promo_header {
font-size: 40px;
}
.promo_subheader {
font-size: 30px;
}
.reason_item {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
}
.reason_text {
margin-top: 20px;
}
.footer_mobile img {
max-width: 65px;
}
.footer_links_main {
width: 300px;
}
.footer_links_main a {
font-size: 9px;
margin: 0 auto;
-webkit-transform: translateX(-45%);
transform: translateX(-45%);
}
.footer_links_sub {
width: 350px;
padding: 2px;
font-size: 8px;
margin: 0 auto;
-webkit-transform: translateX(-28%);
transform: translateX(-28%);
}
.footer_links_lang {
font-size: 9px;
margin: 0 auto;
-webkit-transform: translateX(-20%);
transform: translateX(-20%);
}
}
@media (max-width: 767px) {
nav {
position: relative;
}
.menu {
position: fixed !important;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/bootstrap-reboot.min.css">
<script src="https://kit.fontawesome.com/0d950b6e58.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="css/bootstrap-grid.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header>
<nav>
<div class="container">
<ul class="menu">
<li class="menu_item"><a href="#" class="menu_link">Главная</a></li>
<li class="menu_item"><a href="#" class="menu_link">Со своим автомобилем</a></li>
<li class="menu_item"><a href="#" class="menu_link">На автомобиле компании</a></li>
<li class="menu_item"><a href="#" class="menu_link">Требования</a></li>
<li class="menu_item"><a href="#" class="menu_link">Контакты</a></li>
<li class="menu_item"><a href="#" class="menu_link">Оставить заявку</a></li>
</ul>
</div>
</nav>
<div class="subheader">
<div class="container">
<div class="row">
<div class="col-md-4 offset-md-1">
<a href="" class="subheader_logo"><img src="/src/image/logo.png" alt=""></a>
<div class="subheader_official">Официальный партнер Uber в Москве</div>
</div>
<div class="col-md-3 offset-md-1 col-xl-2 offset-xl-2">
<div class="subheader_call">Звоните нам ежедневно</div>
<a href="tel:84957970988" class="subheader_phone">8 495 797 09 88</a>
</div>
<button class="subheader_btn">заказать звонок</button>
</div>
</div>
</div>
</div>
</header>
<section class="promo">
<div class="container">
<div class="row">
<div class="col-md-12 offset-md-0 col-lg-10 offset-lg-1">
<h1 class="promo_header">КОМПАНИЯ UBER PARTNERS!</h1>
<h2 class="promo_subheader">ПРИГЛАШАЕМ ВОДИТЕЛЕЙ! НА СВОЕМ АВТО!</h2>
<div class="promo_descr">
Компания UBER динамически развивающаяся. Компания на рынке занимает лидирующее место среди таксомоторных компаний, Компания абсолютно прозрачная вы можете контролировать все процессы у себя в личном кабинете. Бонуcная система.Помимо выполненной работы
по заказам, компания начисляет бонусы за пиковое время.
<br><br> Мы одни из партнеров и зарекомендовали себя как одна из лучших команд в городе Москве. Водители у нас зарабатывают от 80000- 120000 в месяц.
</div>
<button class="promo_btn">ОТПРАВИТЬ ЗАЯВКУ!</button>
</div>
</div>
</div>
</section>
<section class="reason">
<div class="container">
<div class="row">
<div class="black_title">
<div class="label">преимущества</div>
<div class="title">8 причин начать работать с нами</div>
</div>
<div class="col-md-6">
<div class="reason_item">
<div class="reason_round">
<img src="/src/icons/first_blue_icons/1w.png" alt="">
</div>
<div class="reason_text">
<span class="reason_subheader">Никаких наличных, оплата происходит
автоматически</span>
<br> Стоимость поездки оплачивается пассажиром с привязанной банковской карты, т.е. нет никаких рисков связанных с перевозкой наличности как для пассажира, так и для водителя, Вам не нужно искать мелкие деньги для размена.
</div>
</div>
<div class="reason_item">
<div class="reason_round">
<img src="/src/icons/first_blue_icons/2.png" alt="">
</div>
<div class="reason_text">
<span class="reason_subheader">Высокий доход с гарантированными
выплатами</span>
<br> Мы выплачиваем заработную плату на личную банковскую карту водителя! Вам не нужно оформлять ООО, ИП, платить налоги, подавать декларацию, оплачивать бухгалтерские услуги и ведение банковского счета.
</div>
</div>
<div class="reason_item">
<div class="reason_round">
<img src="/src/icons/first_blue_icons/3.png" alt="">
</div>
<div class="reason_text">
<span class="reason_subheader">Комфортное, прозрачное и простое
подключение</span>
<br> Мы подключаем дистанционно и бесплатно, Вам нет необходимости приезжать к нам! Вы присылаете нам копии документов, мы регистрируем Вас и присылаем данные для подключения, через 1-2 дня Вы можете начинать работать!
</div>
</div>
<div class="reason_item">
<div class="reason_round">
<img src="/src/icons/first_blue_icons/4.png" alt=""></div>
<div class="reason_text">
<span class="reason_subheader">Круглосуточная поддержка</span>
<br> В Uber действует круглосуточная поддержка водителей по электронной почте. Если что-то непонятно, Вы всегда можете задать вопрос через On-line консультацию.
</div>
</div>
</div>
<div class="col-md-6">
<div class="reason_item">
<div class="reason_round">
<img src="/src/icons/first_blue_icons/5.png" alt="">
</div>
<div class="reason_text">
<span class="reason_subheader">Комиссия 8% + БОНУСЫ</span>
<br> Комиссия 8% + БОНУСЫ У нас минимальная комиссия и мы выплачиваем бонусы за каждую поездку, некоторые наши конкуренты оставляют бонусы себе. Мы работаем честно и с нами водители зарабатывают больше!
</div>
</div>
<div class="reason_item">
<div class="reason_round">
<img src="/src/icons/first_blue_icons/6.png" alt="">
</div>
<div class="reason_text">
<span class="reason_subheader">Работа в удобное время, никаких
графиков</span>
<br> Вы просто нажимаете кнопку выйти на линию для начала работы, когда решите закончить, нажимаете выйти с линии. Вы можете подрабатывать только утром, вечером, в выходные или праздничные дни!
</div>
</div>
<div class="reason_item">
<div class="reason_round">
<img src="/src/icons/first_blue_icons/7.png" alt="">
</div>
<div class="reason_text">
<span class="reason_subheader">Всегда большое количество заказов</span>
<br> Приложение показывает, где на данный момент больше всего заказов и где действуют повышенные тарифы. У Вас не будет простоя и холостых пробегов. Наши пассажиры всегда приятные и абсолютно неконфликтные люди, которых приятно возить.
</div>
</div>
<div class="reason_item">
<div class="reason_round">
<img src="/src/icons/first_blue_icons/8.png" alt="">
</div>
<div class="reason_text">
<span class="reason_subheader">Без шашечек и наклеек</span>
<br> Вам не нужно менять цвет, устанавливать «шашки» на автомобиль и обклеивать его наклейками.
</div>
</div>
</div>
</div>
</div>
</section>
<section class="mobile">
<div class="container">
<div class="label">Возможности</div>
<div class="title">мобильное приложение убер</div>
<div class="subtitle">Сделайте заказ, совершите поездку и оплатите ее стоимость, используя свой мобильный телефон</div>
<div class="row">
<div class="col-md-6 col-lg-4">
<div class="mobile_item mobile_item_1">
<div class="mobile_item_subtitle">оформление заказа одним касанием</div>
<div class="mobile_item_plus"></div>
</div>
</div>
<div class="col-md-6 col-lg-4">
<div class="mobile_item mobile_item_2">
<div class="mobile_item_subtitle">надежная подача</div>
<div class="mobile_item_plus"></div>
</div>
</div>
<div class="col-md-6 col-lg-4">
<div class="mobile_item mobile_item_3">
<div class="mobile_item_subtitle">прозрачные цены</div>
<div class="mobile_item_plus"></div>
</div>
</div>
<div class="col-md-6 col-lg-4">
<div class="mobile_item mobile_item_4">
<div class="mobile_item_subtitle">безналичная оплата</div>
<div class="mobile_item_plus"></div>
</div>
</div>
<div class="col-md-6 col-lg-4">
<div class="mobile_item mobile_item_5">
<div class="mobile_item_subtitle">обратная связь</div>
<div class="mobile_item_plus"></div>
</div>
</div>
<div class="col-md-6 col-lg-4">
<div class="mobile_item mobile_item_6">
<div class="mobile_item_subtitle">разделить стоимость поездки</div>
<div class="mobile_item_plus"></div>
</div>
</div>
</div>
</div>
</section>
<section class="choice">
<div class="container">
<div class="label label_white">возможности</div>
<div class="title title_white">Выбор - отличная штука!</div>
<div class="subtitle subtitle_white">Закажите автомобиль, который подходит вам по стилю и бюджету</div>
</div>
</section>