- This topic has 7 replies, 3 voices, and was last updated 3 years, 3 months ago by
Ying.
-
AuthorPosts
-
March 4, 2023 at 3:41 am #2554996
Kiva
There’s too much space under the subheadings when I use a separator. How do I remove the padding above the separator? Also, how to make the separators just a plain black stripe rather than two stripes?
March 4, 2023 at 11:30 am #2555638Ying
StaffCustomer SupportHi Kiva,
Do you use GenerateBlocks? If so, you can use the headline block of GenerateBlocks, it gives you full control over the spacing around it, and you can change its paddings/margins easily without using a separator.
If you don’t use GB, then try adding this CSS so you can define the margin of the separator:
.entry-content hr.wp-block-separator { margin-top: 10px !important; margin-bottom: 10px !important; }Also, how to make the separators just a plain black stripe rather than two stripes?
It’s showing 2 lines, because of this CSS, it adds a border to the separator:
.wp-block-separator { border: 1px solid; border-right: none; border-left: none; }But this CSS seems added by WP, do you see any settings in the Seperator block?
As the Separator block is a WP core block, GP doesn’t have much control over it.
March 6, 2023 at 1:54 am #2557086Kiva
Thanks for that. The bottom margin works, but the top margin is still too large — I set the margin to 0 and it still doesn’t get any smaller. Perhaps the margin on the subheadings need to be changed instead?
March 6, 2023 at 4:30 am #2557260David
StaffCustomer SupportHi there,
you can use this CSS to make the HR separator a solid line and adjust its default top and bottom margins:
.entry-content hr.wp-block-separator { border: 0; height: 3px; background: #000; margin-top: 30px; margin-bottom: 30px !important; }And if you want to specifically style it when it comes after a
H2heading then add this CSS:.entry-content h2 + hr.wp-block-separator { margin-top: 0; }Note that the H2 has bottom margin that is set in the Customizer > Typography but changing that will affect all H2s.
The alternative would be to:
1. Don’t add a separator.
2. select the Heading block and in give it an Advanced > Additional CSS Class of:has-underline
3. Add this CSS to your site:h2.has-underline { border-bottom: 3px solid; padding-bottom: 10px; }March 10, 2023 at 1:54 pm #2563491Kiva
I’ve tried these two options below and they didn’t do anything to remove the padding under the H2. I’ve also tried decreasing the line height on H2 but that created another problem that the text overlaps. Is there another way I can get rid of the space under an H2? I can’t select a heading block since I’m not using Generateblocks.
.entry-content hr.wp-block-separator {
border: 0;
height: 3px;
background: #000;
margin-top: 30px;
margin-bottom: 30px !important;
}
And if you want to specifically style it when it comes after a H2 heading then add this CSS:.entry-content h2 + hr.wp-block-separator {
margin-top: 0;
}March 11, 2023 at 5:55 am #2563908David
StaffCustomer SupportTry this:
.entry-content hr.wp-block-separator { border: 0; height: 3px; background: #000; margin-top: 0px; margin-bottom: 30px !important; }can you see the change ?
March 11, 2023 at 11:20 am #2564254Kiva
Unfortunately I can’t see a change with that code either. The bottom margin works, background, height… everything else, just not the top margin.
March 11, 2023 at 12:50 pm #2564330Ying
StaffCustomer SupportThe top margin works if I disable your wp rocket by adding
?nowprocketto the URL:
https://www.screencast.com/t/OKuSlwtxsKy2If this is not what you see, make sure the cache is cleared, or simply disable WP rocket.
-
AuthorPosts
- You must be logged in to reply to this topic.