Global change to spacing between paragraphs and unordered lists that follow

On one of my pages, I added the following to the content css to decrease the spacing between a paragraph and the unordered list that follows it. I’d like to make that change globally. What is the css that I would need to use?

p + ul {
margin-top: -2em;
}

website: https://livewellmobility.com
sample page with fixed list: https://livewellmobility.com/elevators-and-lifts/

Thank you kindly!

Hi @stacyd,

Thank you for writing in, it is actually the <p> tag has the default bottom margin. So that is the one that you need to overwrite.

e.g.

body p {
    margin-bottom: 0;
}

Adding the body tag to the selector, and using the specific margin-bottom property should do the trick of overwriting the default margin of p tags.

If for some reason it does not overwrite it, then you can add the CSS !important statement.

When Using !important statement is The Right Choice

Hope it helps,
Cheers!

I tried that in the main css with the important tag. I even tried a negative margin (-1em). That didn’t quite get me what I needed. Look at the spacing above the bullets on this page: https://livewellmobility.com/elevators-and-lifts/ compared to the spacing above the bullets on this page: https://livewellmobility.com/vehicle-lifts/. The Elevators & Lifts page is what the client wants.

@stacyd,

I checked your website and I don’t see the CSS that my colleagues gave to you. The CSS code that my colleagues works perfectly. See this screenshot below.

I also advise that you will remove this line of CSS code:

p + ul {
margin-top: -2em;
} 

Please add the CSS code to X > Theme Options then CSS.

"Please note that providing custom code is outside the scope of our theme support. Issues that will arise from the use of custom codes should be forwarded to a 3rd party developer."

Thank you.

I found the problem – a previous section of code in my css was missing the closing bracket. Added that and TWO problems were solved. Y’all are the best!

@stacyd,

It’s our pleasure to help you.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.