CSS obsługiwany przez AMP dla poczty e-mail
Important: this documentation is not applicable to your currently selected format websites!
Ten dokument przedstawia w zarysie funkcje CSS obecnie obsługiwane w wiadomościach e-mail AMP.
Stosowanie CSS
Wewnętrzny arkusz stylów
W razie stosowania wewnętrznego arkusza stylów CSS należy określić w jednym znaczniku <style amp-custom> umieszczonym w sekcji <head> wiadomości e-mail.
Style inline
Oprócz stosowania wewnętrznego arkusza stylów, można określać style inline w dowolnym elemencie za pomocą atrybutu style.
Zewnętrzny arkusz stylów
Zewnętrzne arkusze stylów nie są obsługiwane w AMP dla poczty e-mail.
Stosowanie znaczników <link rel="stylesheet" href="..."> w wiadomości e-mail jest niedozwolone.
Obsługiwane selektory CSS
Proste selektory
- Selektor typu elementname
- Selektor klasy .classname
- Selektor identyfikatora #idname
- Selektor uniwersalny *
- Selektor atrybutu [attr=value]
Kombinatory
- Kombinator sąsiadujących elementów równorzędnych A + B
- Kombinator ogólny elementów równorzędnych A ~ B
- Kombinator elementów podrzędnych A > B
- Kombinator elementów potomnych A B
Pseudoklasy
- :active
- :checked
- :default
- :disabled
- :empty
- :enabled
- :first-child
- :first-of-type
- :focus
- :focus-within
- :hover
- :in-range
- :indeterminate
- :invalid
- :last-child
- :last-of-type
- :last-of-type
- :not
- :nth-child
- :nth-last-child
- :nth-last-of-type
- :nth-of-type
- :only-child
- :only-of-type
- :optional
- :out-of-range
- :read-only
- :read-write
- :required
- :valid
Obsługiwane właściwości CSS
- -moz-appearance
- -webkit-appearance
- -webkit-tap-highlight-color
- align-content
- align-items
- align-self
- appearance
- azimuth
- background
- background-attachment
- 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
- bottom
- box-shadow
- box-sizing
- break-after
- break-before
- break-inside
- caption-side
- caret-color
- clear
- color
- color-adjust
- column-count
- column-fill
- column-gap
- column-rule
- column-rule-color
- column-rule-style
- column-rule-width
- column-span
- column-width
- columns
- counter-increment
- counter-reset
- cursor
- direction
- display
- elevation
- empty-cells
- filter
- flex
- flex-basis
- flex-direction
- flex-flow
- flex-grow
- flex-shrink
- flex-wrap
- float
- font
- 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-variation-settings
- font-weight
- gap
- grid
- grid-area
- grid-auto-columns
- grid-auto-flow
- grid-auto-rows
- grid-column
- grid-column-end
- grid-column-start
- grid-row
- grid-row-end
- grid-row-start
- grid-template
- grid-template-areas
- grid-template-columns
- grid-template-rows
- height
- hyphens
- image-orientation
- image-resolution
- inline-size
- isolation
- justify-content
- justify-items
- justify-self
- left
- letter-spacing
- line-break
- line-height
- list-style
- list-style-position
- list-style-type
- margin
- margin-bottom
- margin-left
- margin-right
- margin-top
- max-height
- max-width
- min-height
- min-width
- mix-blend-mode
- object-fit
- object-position
- offset-distance
- opacity
- order
- outline
- outline-color
- outline-offset
- outline-style
- outline-width
- overflow
- overflow-x
- overflow-y
- overflow-wrap
- padding
- padding-bottom
- padding-left
- padding-right
- padding-top
- pause
- pause-after
- pause-before
- perspective
- perspective-origin
- pitch
- pitch-range
- place-items
- position
- quotes
- resize
- richness
- right
- row-gap
- speak
- speak-header
- speak-numeral
- speak-punctuation
- speech-rate
- stress
- table-layout
- text-align
- text-align-last
- text-combine-upright
- text-decoration
- text-decoration-color
- text-decoration-line
- text-decoration-skip
- text-decoration-style
- text-emphasis
- text-emphasis-color
- text-emphasis-position
- text-emphasis-style
- text-indent
- text-justify
- text-orientation
- text-overflow
- text-shadow
- text-transform
- text-underline-position
- top
- transform
- transform-box
- transform-origin
- transform-style
- transition
- transition-delay
- transition-duration
- transition-property
- transition-timing-function
- unicode-bidi
- vertical-align
- visibility
- voice-family
- white-space
- width
- word-break
- word-spacing
- word-wrap
- writing-mode
- z-index
Dodatkowe ograniczenia
Następujące właściwości CSS mają dodatkowe ograniczenia:
| Właściwość | Ograniczenia | 
|---|---|
| cursor | Jedyne dozwolone wartości to pointeriinitial. | 
| filter | Konstruktor url()jest niedozwolony. | 
| transition | Animować można jedynie właściwości opacity,transform,visibilityioffset-distance. | 
| visibility | Jedyne dozwolone wartości to hidden,visibleiinitial. | 
| z-index | Dozwolone są jedynie wartości z zakresu od -100 do 100. | 
Reguły at-rules
Jedyna obecnie obsługiwaną regułą at-rule jest @media. Więcej informacji zawiera sekcja Funkcje media.
Czcionki niestandardowe (@font-face) 
Czcionki niestandardowe nie są obsługiwane w AMP dla poczty e-mail.
Funkcje media
Lista funkcji media obsługiwanych w celu warunkowego stosowania reguł poprzez zapytania @media.
- device-width
- max-device-width
- min-device-width
- hover
- orientation
- pointer
- resolution
- max-resolution
- min-resolution
- width
- max-width
- min-width