loader image

Sticky Header Columns

Sticky Header Columns

A sticky header container with two columns that reducing size when scrolling. This effect can reduce the size of an image and expand the column containing the menu content
CSS only

Rate this tutorial

Template Example

CREDIT Rob Edge
CSS NEEDED

/* Change the Background Colour on Scroll */
.elementor-sticky--effects {
background: #ffffffac !important;
transition: background 0.5s ease-in-out;
}

/* Default widths for .col1 and .col2 */
.col1 {
width: 50%;
transition: width 0.3s ease;
}

.col2 {
width: 50%;
transition: width 0.3s ease;
}

/* When the header becomes sticky, adjust the column widths */
.elementor-sticky--effects .col1 {
width: 20%;
}

.elementor-sticky--effects .col2 {
width: 80%;
}

/* Tablet Adjustments (typically for screens 768px - 1024px wide) */
@media (max-width: 1024px) {
.col1 {
width: 40%; /* Adjust for better appearance on tablet */
}

.col2 {
width: 60%; /* Adjust for better appearance on tablet */
}

/* When the header becomes sticky on tablet */
.elementor-sticky--effects .col1 {
width: 30%;
}

.elementor-sticky--effects .col2 {
width: 70%;
}
}

/* Mobile Adjustments (typically for screens up to 768px wide) */
@media (max-width: 768px) {
.col1 {
width: 50%; /* Adjust for better appearance on mobile */
}

.col2 {
width: 50%; /* Adjust for better appearance on mobile */
}

/* When the header becomes sticky on mobile */
.elementor-sticky--effects .col1 {
width: 70%;
}

.elementor-sticky--effects .col2 {
width: 30%;
}
}

HTML NEEDED

No Additional HTML Required

robedge.com | mt irvine tobago w.i. | 868.276.2665 | robedge@gmail.com