Custom Stylesheet Examples
Here you can find some example stylesheets that can be used for formatting the document.
Important: Do not set the body and HTML height to 100% in the stylesheet if you are using cover pages. Set it to 99% instead.
You can format bold texts by referring to the header HTML element.
For example, this code changes the color of header1 to red and header2 to blue:
h1{
color:red;
}
h2{
color:blue;
}
You can format bold texts by referring to the paragraph HTML element.
To change the text align to justify, include this in the stylesheet:
p{
text-align:justify;
}
To strike through a text, use this:
p{
text-decoration:line-through
}
You can format bold texts by referring to the strong HTML element.
For example, this code sets the color of the bold texts to blue:
strong{
color:blue
}
You can use the
'@page'
rule to set the page size.You can use absolute values:
@page{
size: <width> <height>;
}
Or you can use the paper size name:
@page{
size: A4;
}
Use the following in the CSS to add all Confluence pages in a new page:
h1{
page-break-before:always
}
Important: This makes an empty page before the first page too.
Use the the page-bottom CSS class to format the page bottom macro.
.page-bottom{
border: 1px solid red;
}
To have line breaks in code block macro, add the following:
pre{
white-space: pre-wrap;
}
Last modified 4mo ago