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

Remember when editing the Custom Styles Sheet, you can customize the Web, PDF, and Ebook versions. If you want the change to occur across all three formats, you will need to copy the code to each drop-down (top).

 

The amount of padding around a heading can be adjusted using Custom Styles. Changes will remain consistent throughout the text.

  1. On the Dashboard, select Appearance then Custom Styles
  2. In the Your Web Styles box, add the CSS shown below
  3. Adjust the padding size by increasing or decreasing the number after margin-bottom: and margin-top:

Custom CSS H3

.chapter h3{
margin-bottom:0.5;
}
main *+p {
margin-top: 0em;
}

 

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;
}

License

Icon for the Creative Commons Attribution 4.0 International License

Digging Deeper into Pressbooks Visual Design Copyright © 2023 by Erin Fields and Leila Malkin is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.

Share This Book