The video banner is a video that plays in the background while having other elements on top of it. Building the banner requires the following structure:
.ucla-banner__video - Container for the banner
.ucla-banner__video_overlay.ucla-opacity-60.ucla-has-background-black - Colored overlay to darken
video
button.ucla-banner__video_button-control - Video controls to pause/play
svg - Play/Pause icon
video - Video player
source[src=*.webm] - webm video file (optional but recommended)
source[src=*.mp4] - mp4 video file (required)
.ucla-banner__video_content - Content inside the video banner
Lorem
ipsum dolor sit amet consectetuer adipiscing
You can insert any content in the .ucla-banner__video_content. However, it is recommended to use the Grid System inside the element and space it out using the spacing reference in the Developer Documenation tab.
The min-height is set as an inline-style on the container element .ucla-banner__video. We did this so you can have the flexibility to set the height you need.
Responsive Height
To have an adjustable height, you will need to do so in a CSS file with media-queries. Note: You must remove the inline-style so that it doesn’t override the CSS
.ucla-banner__video {
min-height: /* your height here */
}
@media (/* your target media */) {
.ucla-banner__video {
min-height: /* your height here */
}
}
Video Files
It is recommended to compress the video file as much as possible without reducing quality. Fortunately the <video> element supports multiple sources as a child. MDN Docs
You can use any video file but make sure to use mp4 as a fallback just in case your desired video format isn’t supported by a browser.
To meet WCAG 2.1 AA, the contrast ratio of text needs to be at least 4.5:1. You must adjust the overlay so that it meets this requirement by adjusting the .ucla-opacity-{number} class. Refer to our Colors for opacity settings.
Lorem
ipsum dolor sit amet consectetuer adipiscing