Overview
The Natours website features a stunning hero header and a comprehensive footer, both implementing modern CSS techniques including gradient overlays, clip paths, and interactive link effects.
The header component is defined in sass/components/layout/_header.scss and the footer in sass/components/layout/_footer.scss.
The header serves as the hero section of the website, featuring a full-width background image with a gradient overlay and a distinctive angled bottom edge created with CSS clip-path.
< header class = "header" >
< div class = "header__logo-box" >
< img src = "./img/logo-white.png" alt = "Logo" class = "header__logo" >
</ div >
< div class = "header__text-box" >
< h1 class = "heading-primary" >
< span class = "heading-primary--main" > Outdoors </ span >
< span class = "heading-primary--sub" > is where life happens </ span >
</ h1 >
< a href = "#section-tours" class = "btn btn--white btn--animated" > Discover our tours </ a >
</ div >
</ header >
.header {
height : 97 vh ;
background-image : linear-gradient (
to right bottom ,
rgba ( $color-primary-light , 0.8 ),
rgba ( $color-primary-dark , 0.8 )),
url ( '../img/hero.jpg' );
background-size : cover ;
background-position : top ;
-webkit-clip-path : polygon ( 0 0 , 100 % 0 , 100 % 75 vh , 0 100 % );
clip-path : polygon ( 0 0 , 100 % 0 , 100 % 75 vh , 0 100 % );
position : relative ;
}
Visual Description
The header creates an immersive hero section with these visual characteristics:
Height & Positioning Takes up 97% of the viewport height (97vh), creating a full-screen hero effect while leaving a subtle hint of content below.
Gradient Overlay Uses a linear gradient from #7ED56F (light green) to #28B485 (dark green) with 80% opacity, creating a vibrant teal overlay over the hero image.
Background Image The hero image (hero.jpg) is set to cover ensuring it fills the entire header area, with top positioning to keep the most important part of the image visible.
Angled Bottom Edge Uses clip-path: polygon() to create a diagonal cut at the bottom, starting at 75vh on the right and sloping down to 100% on the left.
The clip-path polygon coordinates work as follows:
0 0 = top-left corner
100% 0 = top-right corner
100% 75vh = right side at 75% viewport height
0 100% = bottom-left corner
This creates the distinctive angled bottom edge.
& __logo-box {
position : absolute ;
top : 4 rem ;
left : 4 rem ;
.header__logo {
height : 3.6 rem ;
}
}
The logo is positioned in the top-left corner:
< div class = "header__logo-box" >
< img src = "./img/logo-white.png" alt = "Logo" class = "header__logo" >
</ div >
Absolute Positioning
The logo box uses position: absolute to remove it from the normal document flow, allowing it to sit on top of the header background.
Corner Placement
top: 4rem and left: 4rem place the logo 40px from the top and left edges, providing comfortable breathing room.
Logo Sizing
The logo image has a fixed height of 3.6rem (36px) while width adjusts automatically to maintain aspect ratio.
& __text-box {
position : absolute ;
top : 40 % ;
left : 50 % ;
transform : translate ( -50 % , -50 % );
text-align : center ;
}
The main heading and call-to-action button are centered in the header:
< div class = "header__text-box" >
< h1 class = "heading-primary" >
< span class = "heading-primary--main" > Outdoors </ span >
< span class = "heading-primary--sub" > is where life happens </ span >
</ h1 >
< a href = "#section-tours" class = "btn btn--white btn--animated" > Discover our tours </ a >
</ div >
Perfect Centering Technique
The text box uses a classic CSS centering technique:
Position : Set to absolute to enable precise positioning
Initial Position : top: 40% and left: 50% move the top-left corner of the element
Transform : translate(-50%, -50%) shifts the element back by half its own width and height
Result : Perfect horizontal and vertical centering
The text box is positioned at 40% from the top rather than 50% to create a more visually appealing composition, following the rule of thirds in design.
HTML Structure
SCSS Styles
< header class = "header" >
< div class = "header__logo-box" >
< img src = "./img/logo-white.png" alt = "Logo" class = "header__logo" >
</ div >
< div class = "header__text-box" >
< h1 class = "heading-primary" >
< span class = "heading-primary--main" > Outdoors </ span >
< span class = "heading-primary--sub" > is where life happens </ span >
</ h1 >
< a href = "#section-tours" class = "btn btn--white btn--animated" >
Discover our tours
</ a >
</ div >
</ header >
The gradient overlay uses color variables defined in _variables.scss:
$color-primary-light : #7ED56F ; // Light green
$color-primary-dark : #28B485 ; // Dark green
The gradient creates a smooth transition from light to dark green:
linear-gradient(
to right bottom, // Direction
rgba( $color-primary-light , 0 .8 ), // Light green at 80% opacity
rgba( $color-primary-dark , 0 .8 ) // Dark green at 80% opacity
)
Both -webkit-clip-path and clip-path are included for better browser compatibility. The -webkit- prefix supports older versions of Safari and Chrome.
The footer provides a dark, elegant close to the page with navigation links, copyright information, and interactive hover effects.
< footer class = "footer" >
< div class = "footer__logo-box" >
< img src = "img/logo-green-2x.png" alt = "Full logo" class = "footer__logo" />
</ div >
< div class = "row" >
< div class = "col-1-of-2" >
< div class = "footer__navigation" >
< ul class = "footer__list" >
< li class = "footer__item" >< a href = "#" class = "footer__link" > Company </ a ></ li >
< li class = "footer__item" >< a href = "#" class = "footer__link" > Contact us </ a ></ li >
< li class = "footer__item" >< a href = "#" class = "footer__link" > Careers </ a ></ li >
< li class = "footer__item" >< a href = "#" class = "footer__link" > Privacy policy </ a ></ li >
< li class = "footer__item" >< a href = "#" class = "footer__link" > Terms </ a ></ li >
</ ul >
</ div >
</ div >
< div class = "col-1-of-2" >
< p class = "footer__copyright" >
Built by < a href = "#" class = "footer__link" > Marcos Laurindo Ferreira </ a >
for his online course Advanced CSS and Sass. Copyright © by
Marcos Laurindo Ferreira.
</ p >
</ div >
</ div >
</ footer >
.footer {
background-color : $color-grey-dark-3 ;
padding : 10 rem 0 ;
font-size : 1.4 rem ;
}
The footer establishes a dark foundation:
Background : #333 (dark grey) creates a clear visual separation from the main content
Padding : 10rem (100px) top and bottom provides generous spacing
Font Size : 1.4rem (14px) for comfortable readability
& __logo-box {
text-align : center ;
margin-bottom : 8 rem ;
}
& __logo {
width : 15 rem ;
height : auto ;
}
The logo is prominently displayed at the top of the footer:
< div class = "footer__logo-box" >
< img src = "img/logo-green-2x.png" alt = "Full logo" class = "footer__logo" />
</ div >
Centered Alignment text-align: center centers the logo horizontally within its container.
Spacing margin-bottom: 8rem (80px) creates substantial space between the logo and footer content.
& __navigation {
border-top : 1 px solid $color-grey-dark-1 ;
padding-top : 2 rem ;
display : inline-block ;
}
& __list {
list-style : none ;
}
& __item {
display : inline-block ;
& :not ( :last-child ) {
margin-right : 1.5 rem ;
}
}
The navigation creates a horizontal list of links:
Border Top
A subtle 1px border in #777 (grey) separates the navigation from the logo area.
Inline Display
Both the navigation container and individual items use inline-block to create a horizontal layout.
Item Spacing
margin-right: 1.5rem adds 15px of space between navigation items, except for the last item.
The footer links feature sophisticated hover effects:
& __link {
& :link ,
& :visited {
background-color : $color-grey-dark-3 ;
color : $color-grey-light-1 ;
text-decoration : none ;
text-transform : uppercase ;
display : inline-block ;
transition : all .2 s ease ;
}
& :hover ,
& :active {
color : $color-primary ;
box-shadow : 0 1 rem 2 rem rgba ( $color-black , .4 );
transform : rotate ( 5 deg ) scale ( 1.3 );
}
}
Link States Breakdown
& :link ,
& :visited {
background-color : $color-grey-dark-3 ; // #333 dark grey
color : $color-grey-light-1 ; // #F7F7F7 light grey
text-decoration : none ; // Removes underline
text-transform : uppercase ; // Capitalizes text
display : inline-block ; // Enables transforms
transition : all .2 s ease ; // Smooth 200ms animation
}
Hover Effect Visualization
When a user hovers over a footer link, three simultaneous effects occur:
Color Change : Text changes from light grey (#F7F7F7) to primary green (#55C57A)
Shadow : A dark shadow appears (0 10px 20px rgba(0,0,0,0.4)) creating depth
Transform : The link rotates 5 degrees clockwise and scales up to 130% of its original size
The transition: all .2s ease on the default state ensures all property changes animate smoothly over 200 milliseconds with an easing function.
& __copyright {
border-top : 1 px solid $color-grey-dark-1 ;
padding-top : 2 rem ;
width : 80 % ;
color : $color-grey-light-1 ;
float : right ;
}
The copyright section mirrors the navigation styling:
< div class = "col-1-of-2" >
< p class = "footer__copyright" >
Built by < a href = "https://marcotech.dev.br" class = "footer__link" > Marcos Laurindo Ferreira </ a >
for his online course < a href = "#" class = "footer__link" > Advanced CSS and Sass </ a > .
Copyright © by Marcos Laurindo Ferreira. You are 100% allowed to use this
webpage for both personal and commercial use, but NOT to claim it as your own design.
</ p >
</ div >
The copyright text is set to width: 80% and float: right, creating visual balance with the left-aligned navigation links.
The footer uses the Natours grid system to create a two-column layout:
< div class = "row" >
< div class = "col-1-of-2" >
<!-- Navigation -->
</ div >
< div class = "col-1-of-2" >
<!-- Copyright -->
</ div >
</ div >
This creates a balanced layout:
Left Column : Navigation links in a horizontal list
Right Column : Copyright text and attribution
HTML Structure
SCSS Styles
< footer class = "footer" >
< div class = "footer__logo-box" >
< img src = "img/logo-green-2x.png" alt = "Full logo" class = "footer__logo" />
</ div >
< div class = "row" >
< div class = "col-1-of-2" >
< div class = "footer__navigation" >
< ul class = "footer__list" >
< li class = "footer__item" >
< a href = "#" class = "footer__link" > Company </ a >
</ li >
< li class = "footer__item" >
< a href = "#" class = "footer__link" > Contact us </ a >
</ li >
< li class = "footer__item" >
< a href = "#" class = "footer__link" > Careers </ a >
</ li >
< li class = "footer__item" >
< a href = "#" class = "footer__link" > Privacy policy </ a >
</ li >
< li class = "footer__item" >
< a href = "#" class = "footer__link" > Terms </ a >
</ li >
</ ul >
</ div >
</ div >
< div class = "col-1-of-2" >
< p class = "footer__copyright" >
Built by < a href = "#" class = "footer__link" > Author Name </ a >
for their online course. Copyright © Year.
</ p >
</ div >
</ div >
</ footer >
The footer uses these color variables:
$color-grey-dark-3 : #333 ; // Footer background
$color-grey-dark-1 : #777 ; // Border color
$color-grey-light-1 : #F7F7F7 ; // Text color
$color-primary : #55C57A ; // Hover link color
$color-black : #000 ; // Shadow base color
BEM Naming Convention
Both the header and footer follow the BEM (Block Element Modifier) naming convention:
Block
The main component: .header or .footer
Element
Parts of the component: .header__logo-box, .footer__navigation Elements are denoted with double underscores (__)
Modifier
Variations of blocks or elements (not shown in these examples) Modifiers are denoted with double hyphens (--)
BEM Benefits
Clear Structure The naming convention makes the HTML structure immediately obvious from the class names.
No Nesting Avoids deep CSS selector nesting, improving specificity management and performance.
Reusability Components are self-contained and can be easily moved or reused.
Responsive Considerations
For mobile devices, you may want to add responsive overrides: // Header adjustments for mobile
@media ( max-width : 768 px ) {
.header {
clip-path : polygon ( 0 0 , 100 % 0 , 100 % 85 vh , 0 100 % );
& __logo-box {
top : 2 rem ;
left : 2 rem ;
}
}
}
// Footer adjustments for mobile
@media ( max-width : 768 px ) {
.footer {
& __item {
display : block ;
margin-bottom : 1 rem ;
}
& __copyright {
width : 100 % ;
float : none ;
}
}
}
Key Takeaways
Header
Uses clip-path for angled bottom edge
Gradient overlay with linear-gradient()
Absolute positioning for centering
97vh height for full-screen hero effect
Footer
Dark theme with #333 background
Interactive links with rotate + scale
Grid system for two-column layout
BEM naming convention throughout