• Resolved gorfeas

    (@gorfeas)


    Is there some css that could activate the transparent header feature for the mobile menu as well?

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @gorfeas,

    Try adding this CSS code to Appearance > Customize > Additional CSS from dashboard.

    @media only screen and (max-width: 991px) {
     
        .home #masthead-mobile {
          position: absolute;   
          top: 0;
          width: 100%;
          background-color: transparent;
        }
    
        .home .content-wrapper {
          padding-top: 0;
        }
        
    }
    Thread Starter gorfeas

    (@gorfeas)

    Just tried it and it seems to work.

    However there is still one thing missing to make this work: I need to enable full width and full height in mobile view for the dark background image / video to ocupy the whole screen and make the header visible.

    Any suggestions on the css needed to get rid of the margins/padding on full width blocks?

    Thread Starter gorfeas

    (@gorfeas)

    What I am trying to achieve is to have exactly the same behaviour for the mobile menu as for the desktop:
    Transparent header with a full width background block and a sticky NON-transparent header on scroll.

    Hi @gorfeas,

    Thank you for getting back.

    Upon checking with the current state of your site appearing in mobile screen, you would need to add this custom CSS code:

    @media only screen and (max-width: 991px) {
        #masthead-mobile > div {
            position: sticky;
            top: 0;
        }
    
        .sticky-header-active #masthead-mobile > div {
            position: fixed;
            background-color: #878371;
        }
    }

    Please give it a try and let me know your views.

    Thanks!

    Thread Starter gorfeas

    (@gorfeas)

    Added the above code, plus a 20px botom padding, final code looks like this and is inserted as a code snippet sitewide via the wp/code plugin.

    @media only screen and (max-width: 991px) {
    #masthead-mobile {
    	position: absolute;   
    	top: 0;
    	width: 100%;
    	background-color: transparent;
    	
    	}
    	.content-wrapper {
    	padding-top: 0;
    	margin-top: 0;
    	}
    	
    }
    @media only screen and (max-width: 991px) {
        #masthead-mobile > div {
            position: sticky;
            top: 0;
        }
    
        .sticky-header-active #masthead-mobile > div {
            position: fixed;
            background-color: #878371;
    		padding-bottom: 20px;
        }
    }
    

    I am very happy with the result. Thank you very much for your fast response. I will mark this as resolved

    Thread Starter gorfeas

    (@gorfeas)

    One more thing, how do I force the above mobile header to follow the same display conditions I managed to apply for the desktop transparent header via the customization menu?

    Thread Starter gorfeas

    (@gorfeas)

    When I activate header/footer builder, this code no longer works. What changes should be made to make it work again?
    have a look at my development website: https://wp.emthrace.org

    thank you

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Transparent Mobile header’ is closed to new replies.