Is there a way to include text in a video similar to the style used by PayPal?

PayPal uses the tagline "You Make it, We'll Pay It" displayed on top of a video with a subtle play button located in the corner. By clicking this play button, the video initiates playback and smoothly transitions from a dark overlay to the video itself while keeping the tagline visible. Can you explain how this effect is achieved? Provide some examples if possible, as I find it quite impressive.

Thank you!

Answer №1

View the Demo

Check out this amazing example demonstrating how to display a full-screen video using only CSS with <video> tag, along with text overlaid on the image by utilizing position: absolute.

CSS:

.videoInsert {
    position: absolute;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -100;
    background-size: cover;
    overflow: hidden;
}
h2 span {
    color: white;
    font: bold 24px/45px Helvetica, Sans-Serif;
    letter-spacing: -1px;
    background: rgb(0, 0, 0); 
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    z-index: 999999999999;
    position: absolute;
    margin:auto;
    left:0;
    right:0;
    top:0;
    bottom:0;
    height: 100px;
    width: 80%;
    text-align: center;
}

HTML:

<div class="wrapper">
    <video class="videoInsert">
        <source src="http://www.example.com/video.mp4" type="video/mp4">
        <source src="movie.ogg" type="video/ogg">Your browser does not support the video tag.
    </video>
</div>
<h2><span>A beautiful nature video:<br />Enjoy!</span></h2>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilize a dynamic approach to add the active class to navigation list items

My files all have a header that includes a navigation bar. I am trying to use jQuery to add the 'active' class to the relevant list items (li). The method I initially thought of involved setting a variable on each page, assigning an ID equal to ...

Despite implementing the necessary middleware, the CSS file still refuses to load

My CSS files are not loading properly. When I inspect the element (F12) and go to Networks, my CSS file is not visible. I have added the middleware: app.use(express.static(path.join(__dirname, '/public'))); and required the path above it. I ha ...

Utilize Bootstrap v4.6 to control the visibility of navigation pills based on specific times of the day using JavaScript

My webpage contains two nav-pills that I want to hide during certain hours of the day and then make visible again later on. However, there is a third nav-pill that should remain unaffected and be visible at all times. function showNavPill() { let now = ne ...

AngularJS dropdowns have dependencies on each other

I'm a beginner in AngularJS and I'm attempting to create a dropdown menu that is dependent on another dropdown menu. These are the data sets I have: $scope.objectives = [ {objective: 'LINK_CLICKS'}, {objective: 'MOBILE_A ...

How to align horizontal UL navigation utilizing CSS sprite background

After numerous attempts, I am struggling to center a 4 element horizontal list using a sprite image as the li background within the footer div. My CSS and HTML code is as follows: #footer-share-links { width:400px; text-align:center; margin:10 ...

What's the best way to trigger an alert popup after calling another function?

Here are some HTML codes I've been working with: <button id="hide" onclick="hide()">Hide</button> <p id="pb">This paragraph has minimal content.</p> My goal is to have the paragraph hide first when the button is clicked, foll ...

What is the best way to display a loading screen while simultaneously making calls to multiple APIs?

I'm currently working with Angular 8 to develop an application that retrieves responses from various APIs for users. The application is designed to simultaneously call multiple APIs and I require a loading indicator that stops once each API delivers a ...

State of Active Scroll group

How can I dynamically add the "active" class to a link based on which section it has scrolled to? I want the active state to be applied without a hover effect, only when the corresponding section is currently in view. #pagemenu{ display: block; positio ...

Learn the process of redirecting to a new page using React JS

Currently facing an issue with the Signup button functionality within the Signin dropdown. Instead of opening a new page, it is displaying below the footer. Seeking assistance on how to redirect to a new page when clicking on the signup button. App.js fi ...

Is it possible to create an index.html page with all the necessary head tags to prevent duplicate code across multiple html pages?

Imagine I am using app.js or a Bootstrap CDN link for all of my HTML pages, but I don't want to include it in every single page individually. Is there a way to create an index.html file that includes this so that all other HTML pages load the head fro ...

Discovering the Authentic Page upon Completion of Load using PhantomJS

I am facing an issue while automatically downloading a theme on Wordpress using PhantomJS. The problem arises because the page is not fully evaluated even after it appears to be done loading. When trying to interact with elements on the page, such as clic ...

Retrieve class property in Angular by its name

How can I retrieve an array from a class like the one below without using a switch statement, dictionary, or other collection to look up the name passed into the method? export class ProcessOptions { Arm = [{ name: 'Expedited Review ("ER") ...

`How can I dynamically hide a collapsible Bootstrap navbar with a click event in a React.js application?`

Hey there! I've managed to create a collapsible navbar with Bootstrap 5 that is working smoothly, but now I want it to automatically close when the user clicks on a link. Is there a way to achieve this in React? Thanks in advance! React.JS navbar : ...

Trouble opening attached html file with Asp.net and Google Charts integration

I am facing an issue with my Asp.Net page that includes a grid and an image. The image is a Google Charts chart with a URL of approximately 1600 characters. To send this content as an email attachment, I created an .htm file containing the grid and the ima ...

Tips for retrieving the dynamically generated ID within an li tag

I've been diving into the world of JavaScript and jQuery, encountering a few hurdles as I attempt to merge various solutions that I come across. This code represents a mishmash of tutorials I've recently completed. Admittedly, I am quite new to ...

Shifting Angular Component Declarations to a New Location

Here's a question that might sound silly: In my Angular project, I am looking to reorganize my component declarations by moving them from angular.module.ts to modules/modules.modules.ts. The goal is to structure my src/app directory as follows: src ...

CSS properties for SVG image borders not displaying correctly

I'm having trouble creating a border around a round SVG image with the class "lock feature". When I try to add the border in the CSS element ".lock feature", the text "feature" stays white and the border doesn't show up in the browser. However, i ...

a guide on configuring a default input value from a database in a React component

In my current project, I have an input field with the type of "checkout" and I am looking to utilize Firestore to retrieve a default value. Once I obtain this value, I plan to store it in the state so that it can be modified and updated as needed. Here i ...

What is the best approach to dealing with "Cannot <METHOD> <ROUTE>" errors in Express?

Here is a simple example to illustrate the issue: var express = require('express'); var bodyparser = require('body-parser'); var app = express(); app.use(bodyparser.json()); app.use(errorhandler); function errorhandler(err, req, res, ...

Utilizing Jquery to auto-scroll when an element reaches the top of

I have arrows positioned at the end of sections on my website that I want users to be able to click on in order to scroll to the next section. The issue I am facing is that while the first click works, subsequent clicks do not result in scrolling even thou ...