Вывести header на верх
У меня есть header здесь http://haydaybot2020.xyz/header/flex. При сжатии страницы срабатывает медиа запрос и появляется бургер с меню(которое в будущем будет открываться по бургеру). Как мне вывести header на верх меню (nav.header__menu)
<!DOCTYPE html>
<html>
<head>
<title>Моя шапка 1</title>
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="css/style.css?<? echo time(); ?>">
<!-- Charset -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
</head>
<body>
<div class="wrapper">
<header class="header">
<div class="container">
<div class="header__body">
<a href="" class="header__logo"><img src="img/logo_1.jpg"></a>
<div class="header__burger">
<span></span>
</div>
<nav class="header__menu">
<div class="header__list">
<a href="" class="header__link">
<span>Главная</span>
</a>
<a href="" class="header__link">
<span>Портфолио</span>
</a>
<a href="" class="header__link">
<span>Обо мне</span>
</a>
</div>
</nav>
</div>
</div>
</header>
</div>
<!-- JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</body>
</html>
/*Обнуление*/
*,*:before,*:after{
padding: 0;
margin: 0;
border: 0;
box-sizing: border-box;
}
/*Fonts*/
@font-face{
font-family: "Bold";
src: url(../fonts/FontsFree-Net-SFProDisplay-Bold.ttf)
}
html,body{
height: 100%;
font-family: Arial, sans-serif;
}
.wrapper{
min-height: 100%;
display: flex;
flex-direction: column;
}
.wrapper.content{
flex: 1 1 auto;
}
.header{
position: fixed;
top: 0;
left: 0;
height: 60px;
width: 100%;
background-color: #fff;
border-bottom: 1px solid #eaeaea;
z-index: 2;
}
.container{
max-width: 1180px;
margin: 0 auto;
padding: 0 10px;
height: 100%;
position: relative;
z-index: 3;
}
.header__body{
display: flex;
height: 100%;
align-items: center;
justify-content: space-between;
position: relative;
z-index: 3;
}
.header__logo{
position: relative;
display: block;
flex: 0 0 50px;
z-index: 3;
}
.header__logo img{
max-width: 100%;
position: relative;
border-radius: 50%;
}
.header__link{
text-decoration: none;
height: 100%;
display: flex;
align-items: center;
position: relative;
}
.header__link span{
padding: 0 10px;
font-family: Bold, sans-serif;
font-size: 90%;
text-transform: uppercase;
color:deepskyblue;
}
.header__link:before{
content: '';
position: absolute;
width: 100%;
transition: width 2s ease 0s;
height: 3px;
background-color: deepskyblue;
bottom: 0;
border-radius: 3px 3px 0 0;
opacity: 0;
transition: opacity 5s ease-in-out 0s;
transform: scaleX(0.3) scaleY(0);
transition: all 0.2s ease-in-out;
}
.header__link:hover:before{
opacity: 1;
transform: scaleX(1) scaleY(1);
transition: all 0.3s ease-in-out;
}
.header__list{
height: 100%;
display: flex;
align-items: center;
}
.header__burger{
}
.header__menu{
height:100%;
}
@media(max-width: 550px){
.header__burger{
width: 30px;
height: 20px;
position: relative;
z-index: 3;
}
.header__burger:before,
.header__burger:after{
position: absolute;
content: '';
width: 100%;
height: 2px;
background-color: #000;
}
.header__burger:before{
top:0;
}
.header__burger:after{
bottom:0;
}
.header__burger span{
content: '';
position: absolute;
top: 9px;
background-color: #000;
height: 2px;
width: 100%;
}
.header__menu{
z-index: 1;
display:block;
position: fixed;
top: 0;
left: 0;
height: 100%;
background-color: #fff;
width: 100%;
padding: 70px 0 0 0;
}
.header__list{
display: block;
}
.header__link{
display: block;
height: auto;
margin: 10px 0 0 0;
}
.header__link:first-child{
margin: 0;
}
}
Ответы (1 шт):
Автор решения: КИТ KIT
→ Ссылка
Вы можете вывести ваш бургер с помощью позиционирования куда-угодно просто используя в CSS эти свойства: position, top, left, right, bottom