CSS サポート

インライン <style> ブロックと標準の CSS を使用して、Gmail に送信されるメールのスタイルを設定できます。ほとんどの CSS セレクタ、属性、メディアクエリがサポートされています。サポートされていない CSS プロパティとセレクタは、Gmail で無視されることがあります。

サポートされている CSS プロパティとクエリの一覧については、リファレンス ガイドをご覧ください。

CSS セレクタ

CSS セレクタのサブセットを使用してスタイルを適用できます。Gmail はクラス、要素、ID の セレクタをサポートしています

<html>
  <head>
    <style>
      .colored {
        color: blue;
      }
      #body {
        font-size: 14px;
      }
    </style>
  </head>
  <body>
    <div id='body'>
      <p>Hi Pierce,</p>
      <p class='colored'>This text is blue.</p>
      <p>Jerry</p>
    </div>
  </body>
</html>

CSS メディアクエリ

標準の CSS メディアクエリを使用して、ユーザーの現在のデバイスに合わせてメールのスタイルを調整できます。Gmail では画面の幅、向き、解像度に対する クエリがサポートされています

<html>
  <head>
    <style>
      .colored {
        color: blue;
      }
      #body {
        font-size: 14px;
      }
      @media screen and (min-width: 500px) {
        .colored {
          color:red;
        }
      }
    </style>
  </head>
  <body>
    <div id='body'>
      <p>Hi Pierce,</p>
      <p class='colored'>
        This text is blue if the window width is
        below 500px and red otherwise.
      </p>
      <p>Jerry</p>
    </div>
  </body>
</html>

サポートされている CSS プロパティとクエリ

Gmail では次の CSS プロパティがサポートされています。

  • azimuth
  • background
  • background-blend-mode
  • background-clip
  • background-color
  • background-image
  • background-origin
  • background-position
  • background-repeat
  • background-size
  • border
  • border-bottom
  • border-bottom-color
  • border-bottom-left-radius
  • border-bottom-right-radius
  • border-bottom-style
  • border-bottom-width
  • border-collapse
  • border-color
  • border-left
  • border-left-color
  • border-left-style
  • border-left-width
  • border-radius
  • border-right
  • border-right-color
  • border-right-style
  • border-right-width
  • border-spacing
  • border-style
  • border-top
  • border-top-color
  • border-top-left-radius
  • border-top-right-radius
  • border-top-style
  • border-top-width
  • border-width
  • box-sizing
  • ブレークアフター
  • ブレーク ビフォー
  • 侵入
  • caption-side
  • clear
  • 列数
  • 列フィル
  • カラムギャップ
  • 列ルール
  • 列のルールの色
  • 列ルールスタイル
  • 列ルールの幅
  • 列スパン
  • 列幅
  • direction
  • display
  • elevation
  • empty-cells
  • float
  • フォント
  • font-family
  • font-feature-settings
  • font-kerning
  • font-size
  • font-size-adjust
  • font-stretch
  • font-style
  • font-synthesis
  • font-variant
  • font-variant-alternates
  • font-variant-caps
  • font-variant-east-asian
  • font-variant-ligatures
  • font-variant-numeric
  • font-weight
  • height
  • image-orientation
  • image-resolution
  • ime-mode
  • 隔離
  • layout-flow
  • layout-grid
  • layout-grid-char
  • layout-grid-char-spacing
  • layout-grid-line
  • layout-grid-mode
  • layout-grid-type
  • letter-spacing
  • line-break
  • line-height
  • list-style
  • list-style-position
  • list-style-type
  • margin
  • margin-bottom
  • margin-left
  • margin-right
  • margin-top
  • marker-offset
  • max-height
  • max-width
  • min-height
  • min-width
  • mix-blend-mode
  • object-fit
  • object-position
  • opacity
  • outline
  • outline-color
  • outline-style
  • outline-width
  • overflow
  • overflow-x
  • overflow-y
  • padding
  • padding-bottom
  • padding-left
  • padding-right
  • padding-top
  • 改ページ後の改ページ
  • page-break-before
  • 改ページ
  • pause
  • pause-after
  • pause-before
  • 投球
  • pitch-range
  • 格言
  • richness
  • 音声
  • speak-header
  • speak-numeral
  • speak-punctuation
  • speech-rate
  • 応力
  • table-layout
  • text-align
  • text-align-last
  • text-autospace
  • text-combine-upright
  • text-decoration
  • text-decoration-color
  • text-decoration-line
  • text-decoration-skip
  • text-decoration-style
  • text-emphasis
  • text-emphasis-color
  • text-emphasis-style
  • text-indent
  • text-justify
  • text-kashida-space
  • text-orientation
  • text-overflow
  • text-transform
  • text-underline-position
  • unicode-bidi
  • vertical-align
  • voice-family
  • white-space
  • width
  • word-break
  • word-spacing
  • word-wrap
  • writing-mode
  • ズーム

サポートされているメディアクエリ

サポートされている型

  • すべて
  • 画面

サポートされるクエリ

  • min-width
  • max-width
  • 最小デバイス幅
  • max-device-width
  • 画面の向き
  • 最小解像度
  • max-resolution

サポートされているキーワード

  • and
  • 専用