AEM Native PDF: How to remove list space when no sentence precedes it | Community
Skip to main content
Level 4
August 7, 2024
Solved

AEM Native PDF: How to remove list space when no sentence precedes it

  • August 7, 2024
  • 1 reply
  • 827 views

Hi there,

I'm wondering how I can get lists (OL and UL) to avoid a space break only when no sentence comes before it, or if it is the first bit of content in a section.

Here's an example of the extra space:

Any help is much appreciated, as always!

Thanks!

Josh

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by rkody

It sounds like you need a specific CSS selector to grab the <ol> and <ul> elements that are the first "child" of another element.

CSS Selectors Reference (w3schools.com)

 

In general, this might work for you, but also might have unintended issues:

ol:first-child, ul:first-child { padding-top: 0; margin-top: 0; }

 

It's possible you have styling on the <li> elements causing the spacing. It's hard to answer the question without seeing the template CSS. Regardless, you will have to edit the CSS of your native pdf template to achieve what you want.

1 reply

rkody
rkodyAccepted solution
Level 3
August 21, 2024

It sounds like you need a specific CSS selector to grab the <ol> and <ul> elements that are the first "child" of another element.

CSS Selectors Reference (w3schools.com)

 

In general, this might work for you, but also might have unintended issues:

ol:first-child, ul:first-child { padding-top: 0; margin-top: 0; }

 

It's possible you have styling on the <li> elements causing the spacing. It's hard to answer the question without seeing the template CSS. Regardless, you will have to edit the CSS of your native pdf template to achieve what you want.

Level 4
September 3, 2024

Thanks for your help! Much appreciated! 🙂