I'm struggling to figure out how to centre my logo in the middle of the page, whenever I try to do it with m-auto, it centres the logo between the other items... but not the page. I've tried the right:... method, but had no luck.
This is my code:
.navbar-nav {
flex-direction: row !important;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha256-eSi1q2PG6J7g7ib17yAaWMcrr5GrtohYChqibrV7PBE=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/simple-line-icons/2.4.1/css/simple-line-icons.min.css" integrity="sha256-7O1DfUu4pybYI7uAATw34eDrgQaWGOfMV/8erfDQz/Q=" crossorigin="anonymous" />
<nav class="navbar navbar-light bg-light">
<button class="navbar-toggler" type="button" data-toggle="collapse" onclick="openSideNav()" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<ul class="navbar-nav m-auto">
<a class="navbar-brand" href="#">
<img src="http://pngimg.com/uploads/google/google_PNG19642.png" class="img-fluid" style="max-width:300px;" alt="">
</a>
</ul>
<div class="d-none d-md-block">
<ul class="navbar-nav ml-auto">
<li class="nav-item mr-2 pr-4 my-auto">
<i class="icon-phone mr-1"></i>0122323232323
</li>
<li class="nav-item">
<a class="nav-btn btn btn-lg btn-primary" href="#booking" onclick="openNav()">Book Today <i class="ml-2 icon-calendar"></i></a>
</li>
</ul>
</div>
</nav>
To center the logo, firstly to organise it slightly better you need to make it column not row. So the the phone number and the booking button stack vertically.
Then you need to separate the areas into columns and define their widths making the two sides equal and the center whatever is left over. i.e. left 25% middle 50% and right 25%.
Here is the snippet.
.navbar-nav {
flex-direction: column !important;
justify-content: center;
}
.side {
width: 25%;
}
.middle {
width: 50%;
display: flex;
justify-content: center;
}
.flexend {
display: flex;
justify-content: flex-end;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha256-eSi1q2PG6J7g7ib17yAaWMcrr5GrtohYChqibrV7PBE=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/simple-line-icons/2.4.1/css/simple-line-icons.min.css" integrity="sha256-7O1DfUu4pybYI7uAATw34eDrgQaWGOfMV/8erfDQz/Q=" crossorigin="anonymous" />
<nav class="navbar navbar-light bg-light">
<div class="side">
<button class="navbar-toggler" type="button" data-toggle="collapse" onclick="openSideNav()" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
<div class="middle">
<div class="logo">
<a class="navbar-brand" href="#">
<img src="http://pngimg.com/uploads/google/google_PNG19642.png" class="img-fluid" style="max-width:300px;" alt="">
</a>
</div>
</div>
<div class="side flexend">
<div class="d-none d-md-block">
<ul class="navbar-nav ml-auto">
<li class="nav-item mr-2 pr-4 my-auto">
<i class="icon-phone mr-1"></i>0122323232323
</li>
<li class="nav-item">
<a class="nav-btn btn btn-lg btn-primary" href="#booking" onclick="openNav()">Book Today <i class="ml-2 icon-calendar"></i></a>
</li>
</ul>
</div>
</div>
</nav>
A similar question has already been asked: Center an element in Bootstrap 4 Navbar
I will answer it again because in this case there is a logo image.
<nav class="navbar navbar-light flex-row">
<div class="d-flex flex-fill">
<button class="navbar-toggler" type="button" data-toggle="collapse" onclick="openSideNav()" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
<div class="d-flex flex-fill justify-content-center">
<a class="navbar-brand" href="#">
<img src="http://pngimg.com/uploads/google/google_PNG19642.png" class="img-fluid" style="max-width:300px" alt="">
</a>
</div>
<div class="d-none d-md-flex flex-fill">
<ul class="navbar-nav ml-auto justify-content-end">
<li class="nav-item mr-2 pr-4 my-auto">
<i class="icon-phone mr-1"></i>0122323232323
</li>
<li class="nav-item">
<a class="nav-btn btn btn-lg btn-primary" href="#booking" onclick="openNav()">Book Today <i class="ml-2 icon-calendar"></i></a>
</li>
</ul>
</div>
</nav>
Also, check the docs for the correct Navbar structure because the way you're using the toggler, no expand class or navbar-collapse class isn't standard Navbar structure
https://www.codeply.com/go/8ik1wexpjI
Related
Using Bootstrap 4.3 to make a responsive dashboard, I ran into a problem with medium screens. When I resize Google chrome to check the page in different sizes, sadly, the bootstrap toggle button appears when chrome is resized to medium. This is the case with other browsers as well. The following picture is my chrome showing the page. As in the picture, the screen is not that small for the content to disappear and for the toggle button to show up:
The followings are my codes. I would be really grateful if you help me solve the problem.
#media (max-width: 768px) {
.sidebar {
position: static;
height: auto;
}
.top-navbar {
position: static;
}
}
.top-nav-height {
height: 3em!important;
}
.sidebar {
box-sizing: border-box;
background-color: #34495e !important;
height: 100vh;
}
<body dir="rtl">
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-light p-0 m-0">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#goNavBar" aria-controls="goNavBar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="goNavBar">
<div class="container-fluid">
<div class="row">
<!-- Sidebar -->
<div class="col-md-2 col-xl-2 col-md-5 sidebar p-0 m-0">
ِDashboard
<div id="NavBarParent">
<ul class="navbar-nav flex-column">
<li class="nav-item rtl d-block">
<i class="fas fa-home ml-2"></i>Home
</li>
</ul>
</div>
</div>
<!-- Sidebar Done -->
<!-- Top Bar -->
<div class="col-md-10 col-xl-10 col-md-7 py-3 top-navbar">
<div class="row align-items-center">
<div class="col-md-4 col-sm-4 col-lg-5 col-xl-5">
<h4></h4>
</div>
<div class="col-md-5 col-sm-4 col-lg-5 col-xl-5">
</div>
<div class="col-md-3 col-sm-4 col-lg-2 col-xl-2" >
<ul class="navbar-nav">
<li><span class="fa-layers fa-fw fa-lg" >
<i class="fas fa-envelope py-1" style="color: #34495e"></i>
<span class="fa-layers-counter fa-lg bullet-sizing">45</span>
</span></li>
<li><span class="fa-layers fa-fw fa-lg mr-2" >
<i class="fas fa-bell py-1" style="color: #34495e"></i>
<span class="fa-layers-counter bullet-sizing fa-lg">2</span>
</span></li>
<li class="nav-item mr-auto"><i class="fas fa-sign-out-alt fa-lg" style="color: #34495e"></i></li>
</ul>
</div>
</div>
</div>
<!-- Top Bar Done -->
</div>
</div>
</div>
</nav>
<!-- Navigation Done -->
For the sake of convenience, I deleted some lines from sidebar menu items, as I think they don't have anything to do with the sizing and toggle button.
Wow, the problem was on the very first line. Changing the 'navbar-expand-lg' on the first line of code into 'navbar-expand-sm' solved my issue.
You need to change navbar-expand-(value)Ex lg/md/sm or custom.you can try this i have added with your code.
<body dir="rtl">
<!-- Navigation -->
<nav class="navbar navbar-expand-md navbar-light p-0 m-0">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#goNavBar" aria-controls="goNavBar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="goNavBar">
<div class="container-fluid">
<div class="row">
<!-- Sidebar -->
<div class="col-md-2 col-xl-2 col-md-5 sidebar p-0 m-0">
ِDashboard
<div id="NavBarParent">
<ul class="navbar-nav flex-column">
<li class="nav-item rtl d-block">
<i class="fas fa-home ml-2"></i>Home
</li>
</ul>
</div>
</div>
<!-- Sidebar Done -->
<!-- Top Bar -->
<div class="col-md-10 col-xl-10 col-md-7 py-3 top-navbar">
<div class="row align-items-center">
<div class="col-md-4 col-sm-4 col-lg-5 col-xl-5">
<h4></h4>
</div>
<div class="col-md-5 col-sm-4 col-lg-5 col-xl-5">
</div>
<div class="col-md-3 col-sm-4 col-lg-2 col-xl-2" >
<ul class="navbar-nav">
<li><span class="fa-layers fa-fw fa-lg" >
<i class="fas fa-envelope py-1" style="color: #34495e"></i>
<span class="fa-layers-counter fa-lg bullet-sizing">45</span>
</span></li>
<li><span class="fa-layers fa-fw fa-lg mr-2" >
<i class="fas fa-bell py-1" style="color: #34495e"></i>
<span class="fa-layers-counter bullet-sizing fa-lg">2</span>
</span></li>
<li class="nav-item mr-auto"><i class="fas fa-sign-out-alt fa-lg" style="color: #34495e"></i></li>
</ul>
</div>
</div>
</div>
<!-- Top Bar Done -->
</div>
</div>
</div>
</nav>
<!-- Navigation Done -->
I'm trying to get a picture (below I've tested with a single background color) to cover the navbar aswell as the showcase/jumbotron. However I can't get it to cover both correctly and the navbar is left untouched - even if I create a div that surround the navbar and jumbotron and assign a background picture to this.
Additionally when I try a picture it is stretched in a rather random way across the showcase, how do I get this to cover the elements correctly ?(image size is 1400x693 svg).
<header class="nav-header">
<nav class="navbar navbar-expand-md navbar-light bg-light">
<div class="container">
<span class="navbar-brand"><i>Logo</i></span>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-collapse"
aria-controls="navbar-collapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav ml-auto">
<li class="nav-item"><a class="nav-link" href="#">How it works</a></li>
</ul><!--//nav-->
<ul class="nav navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="#">My Profile</a>
</li>
<li class="nav-item">
<a class="btn btn-outline-success" href="#">Log out</a>
</li>
</ul>
</div>
</div>
</nav><!--//header-->
</header>
<section>
<div class="showcase">
<div class="container">
<div class="jumbotron jumbotron-fluid showcase-content text-white">
<div class="row">
<div class="col-lg-6">
<h2 class="display-4">Some title.</h2>
<p class="lead">Some additional showcase text.</p>
<p>
<a class="btn btn-secondary text-white " href="#">Get Started -></a>
</p>
</div>
<div class="col-lg-6">
<image></image>
</div>
</div>
</div>
</div><!--//container-->
</div>
</section><!--//promo-->
Css
.showcase {
background-color: red;
background-size: cover;
}
.nav-header {
background-color: transparent;
}
.showcase-content {
background-color: transparent;
}
Codepen:
https://codepen.io/anon/pen/vjqvEE
The issue was having bg-light within the navbar which was overriding assigning the colour to the navbar too.
I want to add notification badge to a nav link, and I have 2 problems:
1) I can't make it be over the image top-left.
2) When the navbar is collapsed, the badge goes all the way to the left:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet"/>
<nav class="navbar navbar-expand-lg navbar-light fixed-top" >
<div class="container">
<a class="navbar-brand mx-auto" href="#">
Logo
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse text-right" id="navbarTogglerDemo02">
<ul class="navbar-nav ml-auto mt-2 mt-lg-0">
<li class="nav-item main-nav">
<a id="chats_link" class="nav-link" href="/group_chats.php" style="margin-right:15px;color:white;">
<img title="Chats" src="/resources/chat_navbar.png" alt="Chats" width="25" height="25" style="z-index:10;">
<span class="badge badge-primary" style="z-index:15;float:left;margin-bottom:-10px;left:5px; top:-10px;position:relative;">9</span>)
</a>
</li>
</ul>
</div>
</div>
</nav>
would this be what you are looking for? (added left: -20px; to the style of the badge, removed some other stuff)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet"/>
<nav class="navbar navbar-expand-lg navbar-light fixed-top" >
<div class="container">
<a class="navbar-brand mx-auto" href="#">
Logo
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse text-right" id="navbarTogglerDemo02">
<ul class="navbar-nav ml-auto mt-2 mt-lg-0">
<li class="nav-item main-nav">
<a class="nav-link" href="#" style="margin-right:15px;color:white;">
<img src="https://images.freeimages.com/images/large-previews/e71/frog-1371919.jpg" alt="image" width="35" height="35" style="z-index:10;">
<span class="badge badge-primary" style="z-index:15;position:relative; left: -40px; top:-10px"">9</span>)
</a>
</li>
</ul>
</div>
</div>
</nav>
I'm trying to code a navbar using bootstrap 4, that will show a collapsible button in xs screen sizes and below. I achieved this, however when the button is clicked, the nav links push the button and brand name down, and appear above them, within the navbar. I want them to appear below the navbar.
Can anybody help me with this?
<header>
<nav class="navbar navbar-default">
<div class="container-fluid bg-light ">
<div class="navbar-brand">
<a id="dominik" href="index.html"><h1>Food, LLC</h1></a>
</div>
<div class="pos-f-t">
<div class="collapse" id="navbarToggleExternalContent">
<div class="bg-light p-4">
</div>
<ul id="nav-list" class="nav navbar-nav navbar-collapse">
<li class="nav-item active">
<a class="nav-link" href="#">
<br>Chicken</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<br>Beef</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<br>Sushi</a>
</li>
</ul><!-- #nav-list -->
</div>
<nav class="navbar navbar-light bg-light d-sm-none">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</nav>
</div>
</div><!-- /.container-fluid -->
</nav>
</header>
you are not doing navbar as it is in Official Bootstrap Documentation, in addition, you are putting two nav inside each other which is not mentioned in their documentation.
You can easily copy the navbar code from the documentation as is and then change the names of URLs as you like.
Check this jsfiddle.
Update Code with this
<header>
<nav class="navbar navbar-default">
<div class="container-fluid bg-light ">
<div class="navbar-brand">
<a id="dominik" href="index.html"><h1>Food, LLC</h1></a>
</div>
<nav class="navbar navbar-light bg-light d-sm-none">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</nav>
<div class="pos-f-t">
<div class="collapse" id="navbarToggleExternalContent">
<div class="bg-light p-4">
</div>
<ul id="nav-list" class="nav navbar-nav navbar-collapse">
<li class="nav-item active">
<a class="nav-link" href="#">
<br>Chicken</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<br>Beef</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<br>Sushi</a>
</li>
</ul><!-- #nav-list -->
</div>
</div>
</div><!-- /.container-fluid -->
</nav>
</header>
I am currently in a situation where I have a header like so
<header class="container nav-container">
<nav id="navbar-primary" class="navbar" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
</div><!-- /.container-fluid -->
</nav>
</header>
So it is essentially an empty header with nothing displayed. Instead, for larger screens, the main navigation is actually displayed in the footer
<footer class="footer container">
<div class="collapse navbar-collapse navbar-responsive-collapse" id="navbar">
<ul class="nav navbar-nav">
<li>
<a title="Link1" href="#">Link 1</a>
</li>
<li>
<a title="Link2" href="#">Link 2/a>
</li>
<li>
<a title="Link3" href="#">Link 3</a>
</li>
</ul>
</div>
</footer>
At the moment, when I go down to mobile size, it displays the mobile nav button in the header as it should do. However, when you click on it, it expands the menu in the footer. Is there any way I can put the menu I am using in the footer to display in the header when on mobile size?
Thanks
If you don't mind duplicating the footer html in the header you can do the following (I have a visible header Nav bar in the demo, but I assume you will tweak that):
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Brand</a>
</div>
<div class="container hidden-after-768">
<div class="collapse navbar-collapse navbar-responsive-collapse" id="navbar">
<ul class="nav navbar-nav">
<li>
<a title="Link1" href="#">Link 1</a>
</li>
<li>
<a title="Link2" href="#">Link 2</a>
</li>
<li>
<a title="Link3" href="#">Link 3</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="text-center">
<h1>Bootstrap starter template</h1>
<p class="lead">Use this document as a way to quickly start any new project.<br> All you get is this text and a mostly barebones HTML document.</p>
</div>
</div>
<!-- /.container -->
<footer class="footer container hidden-before-767">
<div class="collapse navbar-collapse navbar-responsive-collapse" id="navbar">
<ul class="nav navbar-nav">
<li>
<a title="Link1" href="#">Link 1</a>
</li>
<li>
<a title="Link2" href="#">>Link 2</a>
</li>
<li>
<a title="Link3" href="#">Link 3</a>
</li>
</ul>
</div>
</footer>
With the CSS:
#media (min-width: 768px)
{
.hidden-after-768
{
display: none;
}
}
#media (max-width: 767px)
{
.hidden-before-767
{
display: none;
}
}
Here's a demo: http://www.bootply.com/render/4NgDES9hYq
(editable version http://www.bootply.com/4NgDES9hYq)
Note that theoretically you should just be able to do <footer class="hidden-xs hidden-sm">, and <div class="hidden-md hidden-lg"> for the header section, but I found there was a point between around 768 and 994 pixels where it showed neither the footer menu nor the hamburger button, so we were left with a dead spot with no navigation links whatsoever. That is why I created the extra #media classes.
you can do this:
<header id="header_wrapper">
<div class="container2">
<div class="header_box">
<nav class="navbar navbar-inverse" role="navigation">
<div class="navbar-header">
<button type="button" id="nav-toggle" class="navbar-toggle" data-toggle="collapse" data-target="#main-nav">
<span class="sr-only">Toggle navigation</spaenter code heren>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div id="main-nav" class="collapse navbar-collapse navStyle">
<ul class="nav navbar-nav" id="mainNav">
<li>></li>
<li></li>
<li></li>
<li>Logout</li>
</ul>
</div>
</nav>
</div>
</div>
</header>
$(document).ready(function(){
if($(window).width() <= 375){
$('#navbar2').html($('#navbar').html())
$('#navbar').html('')
}
else
{
if($('#navbar2').length>1){
$('#navbar').html($('#navbar2').html())
$('#navbar2').html('')
}
}});
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<header class="container nav-container">
<nav id="navbar-primary" class="navbar" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
data-target="#navbar2" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="collapse navbar-collapse navbar-responsive-collapse" id="navbar2"></div>
</div>
</div><!-- /.container-fluid -->
</nav>
</header>
<footer class="footer container">
<div class="collapse navbar-collapse navbar-responsive-collapse" id="navbar">
<ul class="nav navbar-nav">
<li>
<a title="Link1" href="#">Link 1</a>
</li>
<li>
<a title="Link2" href="#">Link 2</a>
</li>
<li>
<a title="Link3" href="#">Link 3</a>
</li>
</ul>
</div>
</footer>
</body>
</html>
You can use a jquery script to move the footer menu to the header menu in mobile view.
I created a temp div in header and adding the footer menu to that div and assigning the toggle menu to that div
You can do this purely with bootstrap 'hidden-X' classes:
https://getbootstrap.com/css/#responsive-utilities
I have made a codepen with an example of a duplicated menu that hides depending on the classes you give it:
https://codepen.io/c0un7z3r0/pen/NjrPvR
The magic works as follows:
Top menu container:
<div class="navbar navbar-inverse navbar-fixed-top hidden-lg" role="navigation">
Bottom menu container:
<div class="navbar navbar-inverse navbar-fixed-bottom hidden-md hidden-sm hidden-xs" role="navigation">
note the hidden-X classes, these determine what circumstances each menu should be shown. I hope this helps!
You could also display your navigation with position: absolute or position: fixed. Just as a quick example :
.navigation {
position: absolute; // in your header
top: 0;
left: 0;
#media screen and (min-width: 40em) {
position: static; // in your footer
}
}