Add Background video to HTML DIV in ASP.Net

on Mar 31, 2019 11:46 PM

i wanted to make background video with the search panel.

Right now, what i have is background image with the search panel.

Can anyone provide me the sample to achieve it.

Download FREE API for Word, Excel and PDF in ASP.Net: Download
on Apr 01, 2019 05:42 AM

Hi chetan,

Refer below sample.

Acording to your requirement change css.


<html xmlns="">
<head runat="server">
            margin: 0;
            position: absolute;
            top: 100px;
            background: rgba(0, 0, 0, 0.5);
            color: #f1f1f1;
            left: 40px;
            object-fit: initial;
            width: 100%;
            height: 300px;
    <form id="form1" runat="server">
        <video autoplay muted loop id="myVideo">
            <source src="Bunny.mp4" type="video/mp4">
            Your browser does not support HTML5 video.
    <div class="content">
        Search :
        <asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
        <asp:Button Text="Search" runat="server" />