Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mjml-hero

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mjml-hero

mjml-hero

  • 2.0.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
524K
decreased by-12.24%
Maintainers
1
Weekly downloads
 
Created
Source

mjml-hero

Display a section with a background image and some content inside (mj-text, mj-button, mj-image ...) wrapped in mj-hero-content component

Fixed height

<mjml>
  <mj-body>
    <mj-container>
      <mj-hero
        mode="fixed-height"
        height="469px"
        background-width="600px"
        background-height="469px"
        background-url="https://cloud.githubusercontent.com/assets/1830348/15354890/1442159a-1cf0-11e6-92b1-b861dadf1750.jpg"
        background-color="#2a3448"
        padding="100px 0px">
        <!-- To add content like mj-image, mj-text, mj-button ... use the mj-hero-content component -->
        <mj-hero-content width="100%">
          <mj-text
            padding="20px"
            color="#ffffff"
            font-family="Helvetica"
            align="center"
            font-size="45"
            line-height="45"
            font-weight="900">
            GO TO SPACE
          </mj-text>
          <mj-button href="https://mjml.io/" align="center">
            ORDER YOUR TICKET NOW
          </mj-button>
        </mj-hero-content>
      </mj-hero>
    </mj-container>
  </mj-body>
</mjml>

sexy

Fluid height

<mjml>
  <mj-body>
    <mj-container>
      <mj-hero
        mode="fluid-height"
        background-width="600px"
        background-height="469px"
        background-url="https://cloud.githubusercontent.com/assets/1830348/15354890/1442159a-1cf0-11e6-92b1-b861dadf1750.jpg"
        background-color="#2a3448"
        padding="100px 0px">
        <!-- To add content like mj-image, mj-text, mj-button ... use the mj-hero-content component -->
        <mj-hero-content width="100%">
          <mj-text
          padding="20px"
          color="#ffffff"
          font-family="Helvetica"
          align="center"
          font-size="45"
          line-height="45"
          font-weight="900">
            GO TO SPACE
          </mj-text>
          <mj-button href="https://mjml.io/" align="center">
            ORDER YOUR TICKET NOW
          </mj-button>
        </mj-hero-content>
      </mj-hero>
    </mj-container>
  </mj-body>
</mjml>

sexy

The height attribute is required only for the fixed-height mode The background position does not work in fluid-height mode on outlook.com For better result we encourage you to use a background image width equal to the hero container width and always specify a fallback background color, in case the user email client does not support background images. Please keep the hero container height below the image height. When the hero container height - both in fixed or fluid modes - is greater than the background image height, we can’t guarantee a perfect rendering in all supported email clients
attributeunitdescriptiondefault value
widthpxhero container widthparent element width
modefluid-height/fixed-heightchoose if the height is fixed based on the height attribute or fluidfluid-height
heightpxhero section height (required for fixed-height mode)0px
background-widthpxwidth of the image used0px
background-heightpxheight of the image used0px
background-urlurlabsolute background urln/a
background-colorcolorhero background color#ffffff
background-positiontop/center/bottom left/center/rightbackground image positioncenter center
paddingpxsupports up to 4 parameters0px
padding-toppxtop offset0px
padding-rightpxright offset0px
padding-leftpxleft offset0px
padding-bottompxbottom offset0px

mjml-hero-content

Display some content in an mj-hero component

Use only one mj-hero-content component inside a mj-hero component
attributeunitdescriptiondefault value
widthpx/percentcontent width100%
alignleft/center/righthorizontal alignmentcenter
background-colorcolorcontent background colortransparent
paddingpxsupports up to 4 parameters0px
padding-toppxtop offset0px
padding-rightpxright offset0px
padding-leftpxleft offset0px
padding-bottompxbottom offset0px

FAQs

Package last updated on 26 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc