[Resolved] hide header on home page only using css

Home Forums Support [Resolved] hide header on home page only using css

Home Forums Support hide header on home page only using css

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #630899
    sparkle

    hello,

    i’ve created a slider that i want to have replace my header on the home page. i’m trying to hide the header with css. i can get it to disappear across the site by using .header-aligned-left .site-header {display: none!important;} but it won’t remove it from the home page if i use body.home .header-aligned-left .site-header {display: none!important;} or .page-id-XXXX .header-aligned-left .site-header {display: none!important;}

    how come? what’s the better way i don’t know?

    thanks.

    #630904
    Leo
    Staff
    Customer Support

    Hi there,

    To remove header on home page only, try this CSS:

    .home .site-header {
        display: none;
    }
    #630913
    sparkle

    hi leo,

    thanks! i swear the first time i tried that it didn’t work, but maybe i used .masthead. now i’d like to get the margin out from between the navigation and my slider .home .separate-containers {margin-top: 0px!important;} isn’t doing it for me.

    thank you!

    #630948
    Leo
    Staff
    Customer Support

    home and separate-containers are both in the <body> tag so there shouldn’t be a space between them:
    .home.separate-containers

    #631023
    sparkle

    huh. i still can’t get it to tighten up.

    #631076
    sparkle

    hm… i took out the home and it works well enough with
    .separate-containers .page-header-contained, .separate-containers .page-header-content-single, .separate-containers .page-header-image, .separate-containers .page-header-image-single {margin-top: 0px!important;}

    #631151
    Leo
    Staff
    Customer Support

    Maybe this is what you are looking for?

    .home.separate-containers .page-header-contained {
        margin-top: 0;
    }
    #631162
    sparkle

    that did it. thank you!

    #631163
    Leo
    Staff
    Customer Support

    No problem 🙂

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.