Reducing Padding Around Headings
Using pre-designed themes in Pressbooks provides consistent and visually appealing spacing around headings to improve readability and aesthetics. The default padding for headings in Pressbooks will vary depending on the chosen theme.
Resourcces
To learn more about Appearance settings and Themes, review the following guide:
Issue
The amount of spacing around headings is dictated by the Pressbooks theme you have chosen, and may contain more padding than you would like.
Solution
The amount of padding around a heading can be adjusted using Custom Styles. Changes will remain consistent throughout the text.
- On the Dashboard, select Appearance then Custom Styles
- In the Your Web Styles box, add the CSS shown below
- Adjust the padding size by increasing or decreasing the number after margin-bottom: and margin-top:
Custom CSS H3
NOTE: This particular code adjusts heading 3. Change the heading number to adjust a different heading (.chapter h1, .chapter h2 etc.). If you would like to change the spacing around every heading, use the code below.
Custom CSS H1-H4
.chapter h1, .chapter h2, .chapter h3, .chapter h4 {
Margin-bottom: 1em ;
}
main *+p {
margin-top: 0em;
}