<nav class="navbar">
<div class="navbar-container">
<div class="navbar-logo">
<a href="#">Logo</a>
<div class="toggle" id="toggle">
<div class="toggle-line"></div>
<div class="toggle-line"></div>
<div class="toggle-line"></div>
</div>
</div>
<div class="navbar-collapse">
<ul class="navbar-nav">
<li class="navbar-item active">
<a href="#" class="navbar-link">Link 1</a>
</li>
<li class="navbar-item">
<a href="#" class="navbar-link">Link 2</a>
</li>
<li class="navbar-item">
<a href="#" class="navbar-link">Link 3</a>
</li>
</ul>
</div>
<div class="navbar-link-buttons">
<a href="#" class="navbar-link-action">Log in</a>
<a href="#" class="navbar-action">Sign up</a>
</div>
</div>
</nav>
<div class="hero">
<img src="https://source.unsplash.com/random/1360x500" alt="">
</div>
$orange-light: #ffe4db;
$orange: #ff784b;
$white: #ffffff;
$black: #000000;
$border: #cdcdcd;
$background: #f5f5f5;
body {
font-family: "Lato", sans-serif;
font-weight: 400;
line-height: 1.5;
font-size: 1 rem;
color: $black;
margin: 0;
padding: 0;
background: $background;
}
.navbar {
padding: 10px 0;
height: 50px;
background-color: $white;
box-shadow: 0 0 8px rgba(0, 0, 0, .1);
display: flex;
@media screen and (max-width: 991px) {
min-height: 70px;
height: auto;
}
&-container {
max-width: 1360px;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
margin: 0 auto;
@media screen and (max-width: 991px) {
flex-direction: column;
}
}
&-logo {
@media screen and (max-width: 991px) {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
}
}
&-logo a {
font-size: 2rem;
text-decoration: none;
color: $black;
font-weight: bold;
text-transform: uppercase;
@media screen and (max-width: 991px) {
display: block;
margin: 0 20px;
padding: 25px 0;
}
}
&-collapse {
display: flex;
justify-content: center;
flex: 1;
@media screen and (max-width: 991px) {
width: 100%;
}
}
&-nav {
list-style: none;
display:flex;
flex-direction: row;
margin: 0;
@media screen and (max-width: 991px) {
flex-direction: column;
width: 100%;
padding: 0 20px !important;
}
}
&-item {
margin: 0 25px;
@media screen and (max-width: 991px) {
margin: 0;
padding: 25px 0;
border-bottom: 1px dashed $border;
}
&:hover a {
color: $orange;
transition: .2s all ease;
}
}
&-link {
text-decoration: none;
color: $black;
font-size: 0.9375rem;
font-weight: bold;
line-height: 1;
@media screen and (max-width: 991px) {
font-size: 1.5rem;
}
}
&-link-buttons {
@media screen and (max-width: 991px) {
width: 100%;
display:flex;
justify-content: space-between;
padding: 25px 0px;
align-items: center;
}
}
&-link-action {
text-decoration: none;
color: $black;
margin-right: 25px;
font-weight: bold;
font-size: .9375rem;
@media screen and (max-width: 991px) {
font-size: 1.5rem;
margin-left: 20px;
margin-top: 20px;
margin-bottom: 20px;
}
}
&-action {
text-decoration: none;
color: $orange;
padding: 8.5px 16.5px;
min-width: 100px;
border-radius: 8px;
background-color: $orange-light;
font-weight: bold;
font-size: .875rem;
@media screen and (max-width: 991px) {
margin-right: 20px;
font-size: 1.375rem;
}
}
}
.active a {
color: $orange !important;
}
.toggle {
display: none;
@media screen and (max-width: 991px) {
display: flex;
flex-direction:column;
margin-right: 20px;
}
&-line {
width: 35px;
height: 4px;
background: $black;
margin: 4px 0;
}
}
/*Hero demo*/
.hero {
width: 100%;
height: 500px;
img {
object-fit:cover;
height:100%;
width:100%
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.