Intro
The media block feature enables cards to spotlight special content for the user. Media blocks are usually used in two ways:
- Media on a card
The media block is used to spotlight special content, with an image or headline on a solid background. - Media as a banner
The media block is used as a standalone banner, with an image or colored background combined with a text layer.
Media block variants and examples
When to Use
Do
- To ensure legibility and to comply with accessibility standards, always make sure that the contrast ratio in your media block or banner is sufficient. You can check contrast ratios using the Color Contrast Analyzer (external tool).
Don't
- Don’t combine text with an image if the media block is used together with other card blocks.
- Don’t use a transparent background for the text area.
Examples
Ensure sufficient contrast between the text and background colors of a media block.
Insufficient contrast between the text and background colors of a media block
For a media block on a card, use either an image or a text with a solid background color.
Don’t combine text and an image in a media block on a card.
Use a solid background color for the text area of a banner and ensure sufficient contrast.
Don’t use a transparent background for the text area of a banner.
Anatomy
Media on a Card
Anatomy: Media on a card - image example
Anatomy: Media on a card - text example
- Media block:
In combination with other card blocks, the media block can only contain an image/graphic (A) OR a solid color plus text (B). - Image or transparent graphic in the media block: Used to decorate and highlight the card. In this case, we don’t recommend adding text content on top.
- Text in the media block: Additional headline to emphasize the subject of the card. In this case, you need to add a solid-colored background to the media block to comply with accessibility standards. The background and text colors must fulfill the contrast ratio requirements (see Accessibility wiki), and can use existing parameters.
Media as a Banner
Anatomy: Media as a banner - example with image and text layer
-
Media block:
The media block of the card can apply a background color. -
Image layer (optional): This layer can be an image or a transparent graphic.
-
Text layer (optional): To comply with accessibility standards, you need to add a solid colored background to the text layer. The background and text colors must fulfill the contrast ratio requirements (see Accessibility wiki), and can use existing parameters.
- Headline (optional): Describes the subject of the banner.
- Byline (optional): Provides additional information on the subject.
- Button (optional): Triggers the action.
Behavior and Interaction
Actions in the Media Block
The positioning of actions depends on how you are using the media block.
- Media on a card:
The media block has no actions. Actions are placed in the card header or footer. - Media as a banner:
You can add one or more actions in the text layer of the banner. Clicking the button triggers the event or navigation to a detail view.
Actions in the media block
Responsive Behavior
Media on a Card
Responsive behavior of a media block with an image
Responsive behavior of a media block with a headline
Media as a Banner
Responsive behavior of a banner with an image layer
Responsive behavior of a banner without an image layer
Banner with an image layer: If the size of the card is reduced, the decorative content always shrinks first. The information in the text layer must always be shown.
If the image and content can no longer be displayed side by side, the card switches to a vertical layout and the card height adapts accordingly (breakpoint: 4 columns).
Related Links
Components
Specifications
- Web Card System
(visual design) - Media in the Web Card System
(interaction design)