Текст внутри видео

#html #css

#HTML #css

Вопрос:

Я хочу добавить видео на свой сайт в заголовок. Как я могу это сделать? Если я сначала использую «источник видео», то он отображает только мое видео. Если нет, я сначала использую заголовок класса div, после чего мое видео исчезает. Я пытаюсь исправить это несколькими способами, но мне это не удалось. Я просто хочу добавить свое видео в заголовок и в свое видео во время воспроизведения, чтобы текст выглядел как «веб-сайт».

 <!DOCTYPE html>
        <html lang="en">
        <head>
                <title>My website </title>
         <style type="text/css">
           * {
          box-sizing: border-box;
        }
        
        /* Style the body */
        body {
          font-family: Arial, Helvetica, sans-serif;
          margin: 0;
        }
        //I want only in header to add my video ,.background-wrap  how to do it?
        /* Header/logo Title */
        .header {
          padding: 80px;
          text-align: center;
          background: #1abc9c;
          color: white;
        }
        
        /* Increase the font size of the heading */
        .header h1 {
          font-size: 40px;
        }
        
        /* Style the top navigation bar */
        .navbar {
          overflow: hidden;
          background-color: #333;
        }
        
        /* Style the navigation bar links */
        .navbar a {
          float: left;
          display: block;
          color: white;
          text-align: center;
          padding: 14px 20px;
          text-decoration: none;
        }
        
        /* Right-aligned link */
        .navbar a.right {
          float: right;
        }
        
        /* Change color on hover */
        .navbar a:hover {
          background-color: #ddd;
          color: black;
        }
        
        /* Column container */
        .row {  
          display: -ms-flexbox; /* IE10 */
          display: flex;
          -ms-flex-wrap: wrap; /* IE10 */
          flex-wrap: wrap;
        }
        
        /* Create two unequal columns that sits next to each other */
        /* Sidebar/left column */
        .side {
          -ms-flex: 30%; /* IE10 */
          flex: 30%;
          background-color: #f1f1f1;
          padding: 20px;
        }
        
        /* Main column */
        .main {   
          -ms-flex: 70%; /* IE10 */
          flex: 70%;
          background-color: white;
          padding: 20px;
        }
        
        /* Fake image, just for this example */
        .fakeimg {
          background-color: #aaa;
          width: 100%;
          padding: 20px;
        }
        
        /* Footer */
        .footer {
          padding: 20px;
          text-align: center;
          background: #ddd;
        }
        
        /* Responsive layout - when the screen is less than 700px wide, make the two columns stack on top of each other instead of next to each other */
        @media screen and (max-width: 700px) {
          .row {   
            flex-direction: column;
          }
        }
        
        /* Responsive layout - when the screen is less than 400px wide, make the navigation links stack on top of each other instead of next to each other */
        @media screen and (max-width: 400px) {
          .navbar a {
            float: none;
            width: 100%;
          }
        }
           
           
           
           
           
           
           
           
           
           * {
               margin: 0;
               padding: 0;
               }
               body {
            font-family: Calibri, sans-serif;
        }
        .background-wrap {
            position:fixed;
            z-index:-1000;
            width:100%;
            height: 100%;
            overflow:hidden;
            top:0; 
            left:0;
        }
        
        
        #video-bg-elem {
            position: absolute;
            top:0;
            left:0;
            min-height:100%;
            min-width:100%;
        }
        
        .content {
        position: relative;
        width:100%;
        min-height:100%;
        z-index:1000%;
        background-colour: rgba(0,0,0,0.7);
        
            
        }
        
        .content h {
            text-align: center;
            font-size: 65px;
            text-transform: uppercase;
            font-weight:300;
            color:#fff;
            padding-top:15%;
            margin-bottom:10px;
        }
        .content p {
            
            text-align:bottom;
            font-size:20px;
            
            color:#aaa;
        }
               
               </style>
           </head>
             
        
        
        
        
        
        
        
        
        <body>
        
        //here I get the video source
        <div class="background-wrap" style="left: 6px; top: 0px">
        <video id="video-bg-elem" preload="auto" autoplay="true" loop="loop" muted="muted">
        <source src="project.mp4" type="video/mp4">
        </video>
        
        //here is the problem the one delete other..I want to get website inside of my video while is playing
        <div class="header">
          <h1>My Website</h1>
          <p>A website created by me.</p>
        </div>
        
        <div class="navbar">
          <a href="#">Link</a>
          <a href="#">Link</a>
          <a href="#">Link</a>
          <a href="#" class="right">Link</a>
        </div>
        
        <div class="row">
          <div class="side">
            <h2>About Me</h2>
            <h5>Photo of me:</h5>
            <div class="fakeimg" style="height:200px;">Image</div>
            <p>Some text about me in culpa qui officia deserunt mollit anim..</p>
            <h3>More Text</h3>
            <p>Lorem ipsum dolor sit ame.</p>
            <div class="fakeimg" style="height:60px;">Image</div><br>
            <div class="fakeimg" style="height:60px;">Image</div><br>
            <div class="fakeimg" style="height:60px;">Image</div>
          </div>
          <div class="main">
            <h2>TITLE HEADING</h2>
            <h5>Title description, Dec 7, 2017</h5>
            <div class="fakeimg" style="height:200px;">Image</div>
            <p>Some text..</p>
            <p>Sunt in culpa qui officia deserunt mollit anim id est laborum consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco.</p>
            <br>
            <h2>TITLE HEADING</h2>
            <h5>Title description, Sep 2, 2017</h5>
            <div class="fakeimg" style="height:200px;">Image</div>
            <p>Some text..</p>
            <p>Sunt in culpa qui officia deserunt mollit anim id est laborum consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco.</p>
          </div>
        </div>
        
        <div class="footer">
          <h2>Footer</h2>
        </div>
        
        
        
        </body>

</html>
    
     <br><br>
    </div>
    
   
  

Комментарии:

1. хм, не понял точно? вы хотите, чтобы текст был поверх видео?

2. @VenkateshKonatham Я хочу, чтобы в заголовке было видео, а внутри текстового веб-сайта. w3schools.com/howto/howto_make_a_website.asp . Это ссылка на w3school, и я хочу, чтобы в заголовке (там написано website) было размещено мое видео.

3. Я не знаю, почему я не могу опубликовать в качестве комментария http-код w3school, но я пишу, как создать веб-сайт w3school в Google.