Email.Mjml.Attributes

HTML & web

Attributes for Email.Mjml layout nodes.

Types

Attribute

type Attribute = Attribute

An opaque layout attribute.

Examples

Email.Mjml.Attributes.href "https://example.com"

Values

attribute

attribute : String -> String -> Attribute

A raw name/value attribute.

Examples

attribute "data-id" "42"

href

href : String -> Attribute

Link target for buttons and anchors.

Examples

href "https://example.com/confirm"

src

src : String -> Attribute

Image URL.

Examples

src "https://cdn.example.com/logo.png"

alt

alt : String -> Attribute

Image alternative text.

Examples

alt "Company logo"

width

width : String -> Attribute

Width in pixels (as a string, for example "600").

Examples

width "600"

height

height : String -> Attribute

Height in pixels (as a string, for example "16"). Used by spacers.

Examples

height "16"

backgroundColor

backgroundColor : String -> Attribute

Background color (#rrggbb or a CSS color name).

Examples

backgroundColor "#f5f5f5"

color

color : String -> Attribute

Foreground / text color.

Examples

color "#111111"

fontSize

fontSize : String -> Attribute

Font size with unit (for example "16px").

Examples

fontSize "16px"

align

align : String -> Attribute

Horizontal alignment ("left", "center", "right").

Examples

align "center"

padding

padding : String -> Attribute

CSS padding (for example "12px 24px").

Examples

padding "12px 24px"