Back to Mjml

README

packages/mjml-head-font/README.md

5.1.01.0 KB
Original Source

mj-font

Imports external fonts and is only applied if the template uses the font.

The href attribute should point to a hosted CSS file that contains a @font-face declaration, for example: https://fonts .googleapis.com/css?family=Raleway

xml
<mjml>
  <mj-head>
    <mj-font name="Raleway"
      href="https://fonts.googleapis.com/css?family=Raleway" />
  </mj-head>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text font-family="Raleway, Arial">
          Hello World!
        </mj-text>
      </mj-column>
     </mj-section>
  </mj-body>
</mjml>

Attributes

attributeacceptsdescriptiondefault value
hrefstringURL of a hosted CSS file
namestringname of the font
<p class="cta-container"><a class="cta" href="https://mjml.io/try-it-live/components/head-font">Try it live</a></p>