Jump to content

7.1 - Fixed header on only one page.

Recommended Posts

Hey everyone!

In 7.1, how would you set the header to a "Fixed position", on only one specific page? 

I.e., on all other pages it should disappear when you start to scroll.

I've searched high and low and it appears that no one has addressed this issue yet.

Any help would be greatly appreciated!

Pierre

Link to comment
48 minutes ago, rwp said:

 


#collection #header {
  position: fixed;
}

 

Thanks so much rwp! This put me on the right path.

I found the collection-id for that specific page. 

This is the end result that worked just great.

#collection-5ef47e01a0680c5b1a28ecac #header {
  position: fixed !important;
  z-index: 1000;   //in case it scrolls behind certain elements further down.
  background: #df4430;  //because header was transparent.
}

 

Link to comment
  • 1 month later...
19 hours ago, Jimi said:

I am putting that into my page header code injection but nothing happens...

 

just this

 

 

Wrap code in style tag, add this to Page Header

<style>
  #header {
  position: fixed !important;
  z-index: 1000;   
  background: #df4430; 
}
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 3 months later...

@tuanphan

On 8/28/2020 at 11:52 AM, tuanphan said:

Wrap code in style tag, add this to Page Header



<style>
  #header {
  position: fixed !important;
  z-index: 1000;   
  background: #df4430; 
}
</style>

 

How would I use this to have a NON-fixed header on only one page? Meaning usually the site has a fixed header but on only one page, I want it NOT to be fixed. In the code, what is the opposite of "fixed?"

Edited by bigpoppapaul
Link to comment
On 12/1/2020 at 7:46 PM, bigpoppapaul said:

@tuanphan

How would I use this to have a NON-fixed header on only one page? Meaning usually the site has a fixed header but on only one page, I want it NOT to be fixed. In the code, what is the opposite of "fixed?"

position: absolute !important;

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 3 months later...

Similar issue. I´m using the fixed header on my site, with transparent background.

So the header has no background color, unless you start scrolling.

This is great, on my front page, I would like to have a background color to the header at all time.

Is this possible?

Link to comment
  • 2 weeks later...
On 3/11/2021 at 3:20 PM, Erlend-fs said:

Similar issue. I´m using the fixed header on my site, with transparent background.

So the header has no background color, unless you start scrolling.

This is great, on my front page, I would like to have a background color to the header at all time.

Is this possible?

Hi. Can you share link to your site? We can help easier

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
On 3/22/2021 at 4:22 PM, Erlend-fs said:

Add to Design > Custom CSS

/* header color */
header#header {
    background: blue !important;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Thanks for your reply tuanphan!

I added the following code to the CSS, and the front-page now looks like this:

/* header color */
#collection-602bc23de4dc477c940dd427
{
header  {
    background: rgba(55,59,61, 0.2) !important;
}}

image.thumb.png.2a48bd5629769637a69c085206a97559.png

 

As you can see, I've added transparency to the header, and I am happy with this (when you land on the front page.)

But I want to remove the transparency "on-scroll" (the menu gets hard to read with content behind)

image.thumb.png.bbac6dc35abffb79382094ed337b66f8.png

 

Is it possible to add another color-code to the header "on-scroll"?

 

Link to comment
19 hours ago, Erlend-fs said:

Thanks for your reply tuanphan!

I added the following code to the CSS, and the front-page now looks like this:

/* header color */
#collection-602bc23de4dc477c940dd427
{
header  {
    background: rgba(55,59,61, 0.2) !important;
}}

image.thumb.png.2a48bd5629769637a69c085206a97559.png

 

As you can see, I've added transparency to the header, and I am happy with this (when you land on the front page.)

But I want to remove the transparency "on-scroll" (the menu gets hard to read with content behind)

image.thumb.png.bbac6dc35abffb79382094ed337b66f8.png

 

Is it possible to add another color-code to the header "on-scroll"?

 

Use new code

/* header color */
header#header.shrink {
    background: blue !important;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

I'm now using these two codes, and it works fantastic!!!🤩

Thank you so much tuanphan!!

 

/* header color- landing */
#collection-602bc23de4dc477c940dd427
{
header  {
    background: rgba(55,59,61, 0.1) !important;
}
  }

 

/* header color on scroll */
#collection-602bc23de4dc477c940dd427
{
header.shrink  {
    background: rgb(55,59,61,) !important;
}
  }

Link to comment

Create an account or sign in to comment

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

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.