Archived topic
Change line spacing when using Element > Hooks
7 replies · Started by Ken on July 6, 2021
I have an FTC disclosure that is above the post content, below the title. I'd like to decrease the white spacing between lines of text.
Here's what I've done so far: Note: the color, font-size works, BUT the line-height doesn't.
****
<span style="color: blue; font-size: 15px"><i>This post may contain affiliate links marked with "#ad" for which I earn a commisson. Note: If you click a link and buy something I may receive some compensation. This does not change the price you pay.</i></span>
****
Screenshot
As always, I appreciate your help, understanding, and suggestions. Thank you, standing by.
Hi Ken,
Can you link us to a sample page where this is applied? So I can inspect the page and help out with the necessary CSS writeup.
You can use the private information text field to provide the link. :D
Doh! sure thing. apologies, I should have thought of that.
Ah right.
That line-height won't work if the parent element's line-height is higher than what you're trying to set.
It's parent element, header.entry-header, has a line-height of 1.5. That element you've added can only go as low as line-height: 1.5; because of its parent.
If you wish to make it go lower than 1.5, you must set the parent element's line-height to 0.3em as well.
Try adding this CSS:
header.entry-header {
line-height: 0.3em;
}
You may want to adjust 0.3em though. I think that's really small.
Thank you Elvin. I'll give it a try. Yeah, I have no clue what 0.3 looks like but I'll try something like 1.3, and play around with it.
Follow-up question: if I do add the CSS you gave me will it affect the site?
OR
It just lowers the line-height but will not affect what I have already written and posted?
Thank you.
header.entry-header mainly affects the entry-title, the entry-meta and the one you've hooked in.
It may affect these elements I've mentioned on the post pages on some sites but on your site, there's a value assigned to them already so it shouldn't be much of an issue. :D
Awesome! Thank you Elvin. As always, your help is much appreciated.
I'll close this ticket with a smile. \(*<>*)/
No problem. Glad to be of any help. :D