Add Background video to HTML DIV in ASP.Net

chetan
 
on Mar 31, 2019 11:46 PM
Sample_206994.zip
3421 Views

i wanted to make background video with the search panel.

https://ibb.co/2q4YGjJ

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
pandeyism
 
on Apr 01, 2019 05:42 AM

Hi chetan,

Refer below sample.

Acording to your requirement change css.

HTML

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

Sreenshot