[All Adaptavist Apps]

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Scrollbar
no-csstrue

Headings CSS

Excerpt

This short tutorial shows you how to change the heading styles using CSS...

By default, Confluence puts a grey background behind most heading styles (h2. to h6.) - this rarely fits with your organisations design guidelines so it's time to take some action...

...

Here's an example of CSS that will do just that:

No Format

h1, h2, h3, h4, h5, h6 {
font-family: trebuchet ms, arial, verdana, lucida grande, sans-serif;
line-height: normal;
font-weight: bold;
background-color: transparent;
border-bottom: none;
}

...

  • They use a specific font-family

     

    Footnote

    When specifying the font, always remember that the person viewing the page might not have that font installed. As such, you should specify alternative fonts (in order of priority) to try and at the end of your list have either sans-serif or serif.

  • Their line-height is normal (so our Text Styles CSS doesn't make them look odd)
  • Their font-weight is set to bold so they stand out from any other text of a similar size
  • Their background-color is transparent (ie. remove that grey background)
  • Thier border-bottom is removed (to remove the blue or grey line that appears under some heading styles)

Footnotes Display

Specific Heading Levels

After deiining the common features for all headings, the next thing to do is define each individual heading (if required).

Because each heading is actually wrapped in an anchor (so that you can link to it), you need two separate styles - one for the heading itself and another to correct any oddities that may appear when the mouse is over the heading.

Example:

No Format

h1 {
font-size: 22px;
color: #003366;
padding: 0px;
padding-bottom: 4px;
padding-top: 12px;
margin: 12px 0px 4px 0px;
}

h1 a:hover {
border-bottom: none;
}

...