Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Marta Template: How to centralise the header (primary navigation) and make it sticky at the top with solid background?



Site URL: https://www.inoutatelier.com

Hi all,

Please see attached site url.

Previously I tried to to make the header sticky at the top but it always appear to at the back of all my content as I scrolled down. Also I would need it have a solid background for the header, and centralised too. Can anyone help with this? 

Many thanks. 

Link to post
  • Answers 8
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Popular Posts

Add to Home > Design > Custom CSS .Header-inner--bottom>div { flex-direction: column; }  

8 answers to this question

Recommended Posts

  • 0

Thank you! The centralise worked. 

I also need the header to be fixed at the top with background when I scroll down, appreciate if you can help on the code.

Thank you!

Link to post
  • 0

Add to Home > Settings > Advanced > Code Injection > Header

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
 $(window).on("scroll", function() {
        //Sticky Header start
   		header = $('header.Header.Header--bottom');
        if ($(window).scrollTop() > 30 ) {
        } else {
  .sticky {
  	position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    width: 100%;
    background: red;


Link to post
  • 0

Hi Tuan,

I would like to make 1 section sticky at the top of one page only and with a transparent background (it's a narrow line of text acting as navigation anchor links).

I'm trying to customise the code you gave above, but not having much luck. I put it in Advanced injection code of that page only, right? Is anything required to go in Design/Advanced/CSS to make it transparent?

This is the section ID:


Thanks so much in advance.

Link to post
  • 0
4 hours ago, Sarah-W said:

@tuanphan Sorry, I shouldn't have said transparent, I mean 50% opacity white. Thanks

Can you share site url? We can check easier

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

  • Create New...