customising alves header
-
I would like to change the Alves header in the following way:
1) Reduce the padding below the title/menu line
2) Place the logo to the left of the site title (it now sits above the site title which is why I don’t use it)
3) Make the header sticky
4) Change the font colourThanks for your help,
InezThe blog I need help with is: (visible only to logged in users)
-
-
Hi there,
1) Reduce the padding below the title/menu line
That cannot be done because that whole space is occupied by the social media icons.
2) Place the logo to the left of the site title (it now sits above the site title which is why I don’t use it)
This might be possible, but it depends on the logo size. Also, all of them (logo and menu) might not fit in a single line.
3) Make the header sticky
This might require a modification of the theme which is not possible with CSS. I’m doing some testing to see if it’s possible.
4) Change the font colour
What font exactly?
-
Thanks fstat.
I can reduce the logo size so that it fits, but don’t know how to write the code for that.
The font is Raleway.
If you could find a way to make the header sticky that would be fab.
And if you could tell me how to change the background colour to the footer that would help too.
Many thanks,
Inez -
-
To make the header stick to the top use this code:
/* Alves header sticky (KK) */ #page #masthead { position: fixed; background: #fff; width: 100%; z-index: 10; padding: 32px; } #page #content { padding-top: 124px; } @media only screen and (max-width: 559px) { #page #content { padding-top: 189px; } }For the footer’s background color, use this one:
/* Footer background color (KK) */ #colophon { background: #eee; }The font is Raleway.
We need to know where exactly is that on your site. The title? The body? elsewhere?
Also, insert your logo, so that we can figure out the code needed to move it.
-
Thanks you. That works perfectly!
I have now added the logo as a guide (need to get higher res, but that’s the size)
-
Also, is there a way to stop the sticky header on mobile. It tends to use up too much of the screen otherwise
-
Okay so, to move your logo, please add this code:
/* Move logo next to title (KK) */ @media screen and (min-width: 560px) { .site-header { grid-template-areas: "site-logo site-title main-navigation" "site-logo site-title social-navigation"; grid-template-columns: 150px 1fr 2fr; } .site-header .site-title, .site-header .main-navigation { align-self: center; } .site-header .site-logo { margin-bottom: 0; } }From the previous code, you’ll need to remove this piece:
@media only screen and (max-width: 559px) { #page #content { padding-top: 189px; } }And then, add this other code block to the media query as well:
/* Alves header sticky (KK) */ @media screen and (min-width: 560px) { #page #masthead { position: fixed; background: #fff; width: 100%; z-index: 10; padding: 32px; } }I hope that helps :).
-
Hi fresatomica,
The code to disable sticky header on mobile is perfect – thanks! – but the code to move the logo has squeezed everything to the left and kept the logo on top. You can see what I mean here: https://growinggoodlives.wordpress.com/
Inez
-
-
Hi Macmanx,
I sorted it now. I had to delete the earlier suggestions and follow the css fresatomic provided.
One last thing: how would I add a drop shadow to the sticky header?
Thanks,
Inez -
Try this:
/* Sticky header shadow (KK) */ #masthead { box-shadow: 0px 5px 25px 0px rgba(0,0,0,0.1); } -
-
-
This should work for you:
/* Justify header elements on mobile (KK) */ @media only screen and (max-width: 559px) { #page #masthead { text-align: center; } .main-navigation>div>ul li { text-align: center; } .main-navigation>div>ul li a { margin: 10px 0; } .social-navigation>div>ul { justify-content: center; } }We generally don’t provide this level of customization support, you can see our CSS scope of support here: https://wordpress.com/support/custom-design/css-support/
If you need more customizations for your site, then you can hire a designer/developer who can help you out.
-
- The topic ‘customising alves header’ is closed to new replies.