Use your own fonts in signup, unsubscribe and update forms

Templates

Updated

Your signup, unsubscribe and update forms can use the same fonts as your website and your emails. You add the font with CSS in the form’s styling, so your contacts see your own font from the first click.

This guide is for you if you know basic CSS. You link to a CSS file with your fonts and write the CSS that decides which parts of the form use them. The Global typeface field in the form only has standard fonts.

Note: This guide applies to the forms on your lists: signup, unsubscribe and update forms. It doesn’t apply to Onsite Campaigns.

Before you start: requirements for your font files

You need a CSS file that loads your fonts, and the font files themselves. If you already use your own fonts in your emails, you can usually use the same CSS file.

  • CSS file with @font-face: A CSS file with an @font-face rule for each font, weight and style you want to use. The file must be publicly available on an https:// address.
  • Font files on https: The font files must also be on https://. Use the woff2 format if you can.
  • Access for other domains (CORS): The server with the font files must send the Access-Control-Allow-Origin header with the value *. Otherwise the browser blocks the font, because the form is shown on a different domain than your font files. Your web developer or web host can set this up.
  • Exact font name: Note the name in font-family in your @font-face rules. It is the name you use in the form’s CSS, and it must be written exactly the same.
  • Licence: Check that your font licence allows you to use the font on the web.

A CSS file with your fonts can look like this, for example:

@font-face {
    font-family: "#your-font-name";
    src: url("https://www.your-website.com/fonts/your-font-regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "#your-font-name";
    src: url("https://www.your-website.com/fonts/your-font-semibold.woff2") format("woff2");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

Note: You can check the CORS header yourself. Open the address of one of your font files in your browser, open the developer tools, and find the font file under Network. Under Response headers, you should see access-control-allow-origin: *.

Step 1: Open your form

Go to Lists, click Actions next to the list, and choose Edit list. Then click Forms in the list’s menu on the left.

Click the name of the form you want to change. To create a new one, click Create form and choose Signup form, Unsubscribe form or Update form. Read more about forms in Forms.

At the bottom of the form, you find the Custom CSS section. Click it to expand it. The field already holds the form’s default styling.

Add an @import with the address of your CSS file on the very first line, above the CSS that is already in the field:

@import url("https://www.your-website.com/fonts/fonts.css");

Note: @import must be on the very first line of the field, before any other CSS. If it is further down, the browser ignores it, and your form is shown in the standard font without any error message.

The CSS only applies to the form you are editing. If you have several forms, add it to each of them.

Step 3: Choose which parts of the form use your font

Below @import, write the CSS that uses your font. Always write the name of your font in quotes, followed by one or more standard fonts. The standard fonts are used if your font can’t be loaded.

In all the examples, replace #your-font-name with the exact name from your @font-face rules.

The whole form

Use your font for all text in the form: headings, text, field labels, fields and buttons.

@import url("https://www.your-website.com/fonts/fonts.css");

body,
label,
input,
select,
textarea,
button,
.form-control,
.btn {
    font-family: "#your-font-name", Arial, sans-serif !important;
}
The Custom CSS section with an @import on the first line, the form’s default styling and a rule that uses the font in the whole form (Danish UI)

Note: The form sets the font from Global typeface on body after your own CSS. A rule for body therefore only works with !important. Rules that target specific elements, as in the examples below, work without !important.

Only the field labels

The field labels are the names above the fields, for example “First name” and “Email”.

label {
    font-family: "#your-font-name", Arial, sans-serif;
    font-weight: 600;
}

The text in the fields

.form-control {
    font-family: "#your-font-name", Arial, sans-serif;
}

The button

.btn-wrapper .btn {
    font-family: "#your-font-name", Arial, sans-serif;
}

Step 4: Save and check the form

Click Save changes at the bottom of the page, or Create form if the form is new.

Then check the font on the form itself. In the overview under Forms, click Actions next to the form and choose Integration. Copy the Web address, and open it in your browser. If the form is already on your website, you can also check it there.

Note: Preview doesn’t show your own CSS, so you can’t see your font in the preview. Use the form’s web address instead.

If your font doesn’t show

If your font can’t be loaded, the form shows the standard fonts after your font name, for example Arial. Check these four things:

  • @import is on the very first line of Custom CSS.
  • The addresses of the CSS file and the font files start with https://.
  • The server with the font files sends the Access-Control-Allow-Origin header. See how to check it under Before you start.
  • The name in font-family is written exactly as in your @font-face rules.

Your form in your own font

You have now linked to your fonts, chosen which parts of the form use them, and checked the result. When the signup form has the same font as the rest of your website, it looks like part of the page and not like a window from another system. The same goes for the unsubscribe and update forms that your contacts open from your emails: they see the same typography in the email, in the form and on your website. If you have several forms, for example one for the newsletter and one for the members’ club, add the same CSS to each of them.

Didn't find the answer?

Write to our support team and we'll help you further.

Contact support