Hey All,
I recently added a code to my debut theme to make the header sticky and now I am encountering an issue where the title of my pages is cut off.
Does anybody know how to fix it?
Thanks!
Hey All,
I recently added a code to my debut theme to make the header sticky and now I am encountering an issue where the title of my pages is cut off.
Does anybody know how to fix it?
Thanks!
Please provide website url and if your store is password protected then also provide password
Hi @MandL ,
This is my recommendation for your problem. You should use css style “position: sticky” instead of “fixed”. You can try and please let know if you need further support.
Hope this helps!
Hi @LitExtension ,
Thank you so much for your reply!
When I try changing fixed to sticky the text turns from red to grey and then when I test my site, the fixed header no longer exists.
Here is the coding I am using that I added to my page:
#shopify-section-header {
position: sticky;
z-index:1000;
left:0;
right:0;
-webkit-box-shadow:0px 2px 4px 0px rgba(0,0,0,.1);
-moz-box-shadow:0px 2px 4px 0px rgba(0,0,0,.1);
-ms-box-shadow:0px 2px 4px 0px rgba(0,0,0,.1);
-o-box-shadow:0px 2px 4px 0px rgba(0,0,0,.1);
box-shadow:0px 2px 4px 0px rgba(0,0,0,.1);
background-color: {{ settings.color_body_bg }};
}
#PageContainer {
padding-top: 80px;
}
@media screen and (max-width: 749px) {
#PageContainer {
padding-top: 70px;
}
Please share:
If the store is not online yet, please follow this quick tutorial to learn how to safely and temporarily share an offline/unpublished theme URL.
Only by taking a look at your website we are able to assist.
Kind regards,
Diego
Hi @MandL ,
Hope you are soing well.
On this selector “#shopify-section-header”, please add this snippet: min-height: 80px; (you can change 80px to your number you want). This problem can cause when you set absolute for child element.
Example:
#shopify-section-header {
position: sticky;
z-index:1000;
left:0;
right:0;
min-height: 80px;
-webkit-box-shadow:0px 2px 4px 0px rgba(0,0,0,.1);
-moz-box-shadow:0px 2px 4px 0px rgba(0,0,0,.1);
-ms-box-shadow:0px 2px 4px 0px rgba(0,0,0,.1);
-o-box-shadow:0px 2px 4px 0px rgba(0,0,0,.1);
box-shadow:0px 2px 4px 0px rgba(0,0,0,.1);
background-color: {{ settings.color_body_bg }};
}
Hope this helps!
Dear @MandL
Hope the following suggestions will help you
/* Start */
.sticky {position: fixed;top: 0;width: 100%;z-index: 999; max-width: 100%;background: #fff;-webkit-box-shadow: 0px 5px 22px -8px rgba(0,0,0,0.75);-moz-box-shadow: 0px 5px 22px -8px rgba(0,0,0,0.75);box-shadow: 0px 5px 22px -8px rgba(0,0,0,0.75);}
/* End*/
// Start sticky Navbar
$(window).scroll(function(){
if ($(this).scrollTop() > 50) {
$('.site-header').addClass('sticky');
}
else {
$('.site-header').removeClass('sticky');
}
});
// End sticky Navbar