CSS Reference
For users with web development experience, the following contains the built-in rules, along with the default additional CSS rules. These rules can be inserted into into your HTML editor during local development.
Base CSS (built-in)
The Base CSS is built into each page and cannot be changed.
While the CSS itself cannot be changed, you can:
Adjust the variables at the top — these align to settings available in the merge template form.
Override the CSS using Additional CSS
/* Variables */
:root {
/* overall page dimensions */
--firstPageTopMargin: 10mm;
--firstPageBottomMargin: 10mm;
--pageTopMargin: 10mm;
--pageBottomMargin: 10mm;
--height: 297mm;
--mediaPrintTopMargin: 20mm !important; /* page header */
--mediaPrintBottomMargin: 20mm !important; /* page footer */
/* to set a background, use url(https://path/to/your/background.png) */
--letterheadFile: none;
/* margins for the letter content */
--topMargin: 20mm;
--leftMargin: 0mm;
--rightMargin: 0mm;
/* address positioning from top left of page */
--addressLeft: 20mm;
--addressTop: 80mm;
}/* The base CSS rules */
@page:first {
size: A4;
margin-top: var(--firstPageTopMargin)mm;
margin-left: 0mm;
margin-right: 0mm;
margin-bottom: var(--firstPageBottomMargin)mm;
}
@page {
size: A4;
margin-top: var(--pageTopMargin)mm;
margin-left: 0mm;
margin-right: 0mm;
margin-bottom: var(--pageBottomMargin)mm;
}
@media print {
html, body {
width: 210mm;
height: var(--height); /* only set if defined */
margin-top: var(--mediaPrintTopMargin);
margin-left: 0mm;
margin-right: 0mm;
margin-bottom: var(--mediaPrintBottomMargin);
}
}
body {
background: white;
background-image: var(--letterheadFile);
background-size: 210mm var(--height);
background-repeat: no-repeat;
font-family: 'Signika', sans-serif;
font-size: 12pt;
}
hr {
color: white;
height: 0px;
border: none;
page-break-after: always;
clear: both;
}
img.media {
float: left;
width: 46%;
padding: 0px 10px 10px;
}
img.signature {
width: 50mm;
float: none;
padding: 0px 10px 10px;
}
article {
margin-top: var(--topMargin); /* only applies to first page */
margin-left: var(--leftMargin);
margin-right: var(--rightMargin);
}
address {
left: var(--addressLeft);
top: var(--addressTop);
position: absolute;
font-style: normal;
}
table td {
vertical-align: top;
text-align: left;
}
img {
padding: 4mm;
}
br {
clear: both;
}Additional CSS (customisable)
The Additional CSS is user-configurable. The following is a good starting point, which provides the classes used in this guide.
This CSS is automatically included for new templates. You can adjust this to suit your needs.
/* Set the default font for the document - everything is relative to this. */
body {
font-size: 11pt !important;
font-family: arial, helvetica, sans-serif;
}
/* Define the headings relative to the default font */
h1 {
font-size: 125%;
font-weight: bold;
}
h2 {
font-size: 100%;
font-weight: bold;
}
h3 {
font-size: 80%;
font-weight: bold;
font-variant: small-caps;
}
/* Create left and right anchored text boxes */
.left-box {
float: left;
width: 49%;
}
.right-box {
float: right;
width: 49%;
}
/* Here's a big, red, important box for an important message */
.warning-box {
border: 1px solid #ff0000;
color: #ff0000;
background-color: #ffcaca;
padding: 4mm;
}
/* Create left, right, center and justify text styles */
.left-text {
text-align: left;
}
.right-text {
text-align: right;
}
.center-text {
text-align: center;
}
.justify-text {
text-align: justify;
}
/* Text for fine-print - can be wrapped multiple times */
.small-text {
font-size: 85%;
}
/* Big, red warning text */
.warning-text {
color: #ff0000;
font-weight: bold;
}
Last updated
Was this helpful?
