Archived topic
Styling of generate_header
6 replies · Started by Carsten on May 3, 2021
Hi there, I'm using the generate_header hook in an element and I want to style it with another background color. There are no color settings for this, and the Inspector does not reveal any selector either?
So how do I style the generate_header?
Thanks!
Hi there,
Can you link us to the page in question so I can inspect it?
You can use the private information text field to provide the details.
Sure
Hi there,
Hooks are simply a 'placeholder' for adding code - they don't generate HTML for styling unless you add the HTML to the content. For example you could add:
<div class="my-customer-header-element">
<!-- your content here -->
</div>
Then you can style the <div> using this CSS:
.my-customer-header-element {
/* Styles here */
}
Or alternatively use the Block Element with the GenerateBlocks plugin as that provides you all visual styling controls you need.
Hi there, thanks for the explanation, I think the confusion is that you can have a hook like generate_after_logo in the existing header, which then can be styled, while creating a custom header, can't.
Thanks for the code
Regards
Carsten
resolved
Thats right - some Hooks are inside a container that will have a CSS Class to select - whereas others do not.
Glad to hear you got it resolved.