Module 7 - Lesson 3
Website Header
Lesson Overview
In this video, we’ll create the website header inside the Theme Builder. Using custom CSS, we’ll add an animated hover effect to menu items, edit the dropdown sub-menu and the mobile menu version.
Video Chapters
style.css
/*
______________________
Header
______________________
*/
/* Column alignment */
#maya-header .et_pb_row {
align-items: baseline;
}
#maya-header .et_pb_row .et_pb_column:first-child {
align-self: flex-end;
}
/* Hide CTA for small phones */
@media (max-width:430px) {
#maya-header .et_pb_column:nth-child(3) {
display:none;
}
}
/* Sticky Section background */
#maya-header {
backdrop-filter: blur(7px)
}
/* Main Menu Module */
#maya-header .et_pb_menu .et-menu>li {
padding:10px 20px;
}
#maya-header .et_pb_menu .et-menu>li a:hover {
opacity:1;
}
/* Top Level Menu Hover Effect */
#maya-header .et_pb_menu .et-menu > li a {
position:relative;
}
#maya-header .et_pb_menu .et-menu > li > a:before {
content:'';
display:block;
position:absolute;
bottom:-20px;
left:0;
right:0;
height:10px;
background:url(img/zigzag.svg) repeat-x;
animation: zigzagPlay 3s infinite linear;
opacity:0;
transition:all .3s ease-in-out;
}
@keyframes zigzagPlay {
0% {
background-position: 0;
}
100% {
background-position:-70px;
}
}
#maya-header .et_pb_menu .et-menu > li > a:hover:before {
opacity:1;
bottom:-10px;
}
/* Submenu */
#maya-header .sub-menu {
border:none;
border-radius:2px;
padding:20px;
width:200px;
transition:all .3s ease-in-out;
top:calc(100% + 9px);
}
#maya-header .sub-menu li {
width:100%;
padding:0;
}
#maya-header .sub-menu li a {
padding:0 0 10px;
font-family:"Barlow", sans-serif;
font-wieght:700;
font-size:16px;
text-transform:none;
letter-spacing:0;
background:none;
transition:all .3s ease-in-out;
}
#maya-header .sub-menu li:last-child a {
padding:0;
}
#maya-header .sub-menu li a:hover {
padding-left:5px;
}
#maya-header .nav li:hover > ul, #maya-header .nav li.et-touch-hover > ul {
top:calc(100% - 1px)
}
/* Mobile Header Structure & Menu */
@media (max-width:980px) {
#maya-header .et_pb_row {
display: flex;
align-items:center;
}
#maya-header .et_pb_column {
margin-bottom:0;
}
#maya-header .et_pb_column:nth-child(1) {
order:1;
}
#maya-header .et_pb_column:nth-child(2) {
order:3;
}
#maya-header .et_pb_column:nth-child(3) {
order:2;
}
#maya-header .et_pb_menu__wrap {
justify-content:flex-end;
}
/* Mobile Menu */
#maya-header .mobile_menu_bar:before {
font-size: 40px;
}
#maya-header .opened .mobile_menu_bar:before {
content:'\4d';
}
#maya-header .et_mobile_menu {
position: fixed;
display: block!important;
margin: 0!important;
height: 100%!important;
min-height: 100vh;
padding: 100px 0 0!important;
max-width: 300px;
left: auto;
right: -300px;
top: 0;
z-index: 39;
transition: all 1s ease-in-out;
}
#maya-header .opened .et_mobile_menu {
right: 0;
}
#maya-header .mobile_menu_bar {
z-index: 40;
}
/* Position "Fixed" inside the Sticky Section fix */
#maya-header.et_pb_sticky * {
transform:none!important;
}
/* Mobile Sub-menu */
#maya-header .sub-menu {
width:auto;
padding:0;
}
#maya-header .sub-menu li a,
#maya-header .sub-menu li a:hover,
#maya-header .sub-menu li:last-child a {
padding:10px 25px 10px 35px;
}
}
Login to your Account
If you're a DSA Student, please log in to your account to access the course content.
Sorry, you don't have access to this content.
It looks like you're not enrolled in Divi Stylist Academy.
