Puedes modificar el estilo del correo electrónico enviado a Gmail mediante bloques <style>
intercalados y CSS estándar. Se admiten la mayoría de los selectores CSS, atributos y consultas de medios.
Gmail puede ignorar las propiedades y los selectores de CSS no admitidos.
Visita la guía de referencia para obtener una lista completa de las consultas y las propiedades de CSS admitidas.
Selectores CSS
Puedes usar un subconjunto de selectores CSS para aplicar estilos. Gmail admite selectores de clase, ID y elementos.
Ejemplo
<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>
Consultas de medios de CSS
Puedes usar las consultas de medios estándar CSS a fin de ajustar el estilo de un correo electrónico para que se ajuste al dispositivo actual del usuario. Gmail admite consultas sobre el ancho de la pantalla, la orientación y la resolución.
Ejemplo
<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>
Consultas y propiedades de CSS compatibles
Gmail admite las siguientes propiedades de CSS:
- azimuth
- background
- background-blend-mode
- background-clip
- background-color
- background-image
- background-origin
- background-position
- background-repeat
- background-size
- borde
- 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
- después de la pausa
- antes de la pausa
- irrumpir
- caption-side
- clear
- color
- recuento de columnas
- relleno de columnas
- intervalo de columna
- regla de columna
- columna-color-regla
- estilo regla-columna
- ancho-regla-columna
- intervalo de columna
- ancho de columna
- columnas
- dirección
- display
- elevation
- empty-cells
- float
- font
- font-family
- font-feature-settings
- font-kerning
- font-size
- font-size-adjust
- font-stretch
- font-style
- font-synthesis
- font-variant
- fuentes-variantes-alternativas
- font-variant-caps
- font-variant-east-asian
- font-variant-ligatures
- font-variant-numeric
- font-weight
- alto
- image-orientation
- image-resolution
- ime-mode
- aislamiento
- 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
- opacidad
- descripción
- outline-color
- outline-style
- outline-width
- overflow
- overflow-x
- overflow-y
- padding
- padding-bottom
- padding-left
- padding-right
- padding-top
- salto de página posterior
- salto de página anterior
- salto de página por dentro
- pausar
- pause-after
- pause-before
- lanzamiento
- pitch-range
- citas
- más funciones
- hablar
- speak-header
- speak-numeral
- speak-punctuation
- speech-rate
- stress
- 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
- zoom
Consultas de medios compatibles
Tipos admitidos
- todos
- pantalla
Consultas admitidas
- min-width
- max-width
- ancho-mín.-dispositivo
- ancho máximo del dispositivo
- orientación
- resolución mínima
- resolución máxima
Palabras clave admitidas
- y
- solo