To put a video in way background in a Webpage with HTML5 and CSS

To put a video as bottom (background) of a webpage with HTML5 being used CSS. HTML5 has become something natural for the modern navigators and is important to take advantage of all the advantages that offer to us nowadays.

As putting a video in way background in a webpage?

In this tutorial we have used the label  

Now only we must add to the following fragment of code in the page or document where they want that a video becomes as bottom of a webpage.

<video you go = " my-video? class = " video? autoplay muted loop> <source src = " videos/video.mp4? type= " video/mp4 " > </video>

If or you have a document CSS or these to create it. Within archives .CSS it places the following line of code.

 

div, h1, p, to, video, h2 \ {z-index: 2; position: relative; } .content \ {position: relative; top: 30%; z-index: 2; margin: 0 car; max-width: 720px; text-align: to center; } .content__heading \ {margin-bottom: 24px; color: RGB (39,39,39); font-size: 44px; } to.content__teaser \ {margin-bottom: 24px; color: RGB (89,89,89); font-size: 22px; } .content__cta \ {display: inline-block; margin: 0; padding: 12px 48px; color: RGB (255,60,100); font-size: 22px; text-decoration: none; to border: solid 4px RGB (255,60,100); } .video \ {position: fixed; top: 50%; left: 50%; z-index: 1; min-width: 100%; min-height: 100%; width: car; height: car; transform: translate (- 50%, -50%); }

After doing the following thing, it will be able to see the realised changes.

The properties of the reproducer of video HTML5 have the following one. autoplay muted loop

Home style of facebook using HTML and CSS

As to create a design Web similar to home or incio of facebook using HTML and CSS. In my case, I did the following thing.

  • To create a file HTML with the name homepage.html or index.html.
  • Within the created file, it puts the following lines of labels HTML.
  • It keeps the changes
<html does > <head > <link href = " homepage_style.css? type= " text/css? rel= " stylesheet?/> </head> <body> <div id= " to header_wrapper " > <div id= " to header " > <li id= " sitename " ><a href = " https://attila-php.net " >attila-php.net</a></li> <form action = " post " > <li>Email or Phone<br><input type= " text? name= " email " ></li> <li>Password<br><input type= " password? name= " password " ><br><a href= "" >Forgotten account? </a></li> <li><input type= " submit? name= " login? value= " Log In " ></li> </form> </div> </div > <div you go = " to wrapper " > <div you go = " div1 " > <p<Talkerscode helps you connect and share with the <br>people in your life.</p> <img src = " images/fb_map_image.png " > </div> <div id= " div2 " > <h1>Create an account</h1> <p>It's free and always will be.</p> <li><input type= " text? to placeholder = " First Yam? id= " firstname " ><input type= " text? to placeholder = " Surname? id= " surname " ></li> <li><input type= " text? to placeholder = " Mobile to number or email address " ></li> <li><input type= " text? to placeholder= " does Re-enter mobile to number or email address " ></li> <li><input type= " password? placeholder= " New password " ></li> <p>Birthday</p> <li> <select ><option>Day</option></select> <select ><option>Month</option></select> <select ><option>Year</option></select> <a href= "" >Why do I need to probidet my date of birth? </a> </li> <li><input type= " radio " >Female <input type = " radio " >Male </li> <li you go = " terms " >By clicking Creates an to you account, you agree to our <a href= "" >Terms</a> and that <br>you have read our <a href= "" >Data Policy </a>, including our <a href= "" >Cookie Use</a>.</li> <li><input type= " submit? value= " Creates an to you account " ></li> <li you go = " create_page " ><a href= "" >Create to for Page</a> to celebrity, band or business.</li> </div> </div> <div id= " to footer_wrapper " > <div id= " to footer 1" > English (UK) <a href= "" >हिन?दी</a><a href = "" >ਪੰਜਾਬੀ</a><a href = "" > اردو </a><a href = "" >தமிழ?</a><a href = "" >বাংলা</a><a href = "" >मराठी</a><a href = "" >తెల?గ?</a><a href = "" >ગ?જરાતી</a><a href = "" >ಕನ?ನಡ</a><a href = "" >മലയാളം</a> </div> <div id= " to footer 2" > <a href= "" >Sign Up </a><a href = "" >Log In </a><a href = "" >Messenger</a><a href = "" >Talkerscode</a><a href = "" >Mobile</a><a href = "" >Find Friends </a><a href = "" >Badges</a><a href = "" >People</a><a href = "" >Pages</a><a href = "" >Places</a><a href = "" >Games</a><a href = "" >Locations</a><a href = "" >Celebrities</a><a href = "" >Groups</a><a href = "" >Moments</a><a href = "" >About</a><a href = "" >Create Advert</a><a href = "" >Create Page</a><a href = "" >Developers</a><a href = "" >Careers</a><a href = "" >Privacy</a><a href = "" >Cookies</a><a href = "" >Ads</a><a href = "" >Terms</a><a href = "" >Help</a> <p>Design By TalkersCode .com </a> </div> </div> </body> </html>

In this step we created three div main of three sections of the main page and the main head, envelope and footer and to add all the contents since it is as facebook.

  • After creating the previous file and filling up it of codes, now it is called on to create file CSS with the name homepage_style.css
  • Homepage_style.css with the following lines of code fills up the file.
  • It keeps the changes
body \ {text-align: to center; width: 100%; margin: 0 car; padding: 0px; font-family: “gracious great?, tahoma, verdana, arial, sans-serif; background: linear-gradient (white, #D3D8E8); } to #header_wrapper \ {width: 100%; min-width: 980px; background-color: #4c66a4; } to #header \ {width: 980px; margin: 0px car; padding: 0px; height: 85px; } to #header li \ {list-style-type: none; float: left; text-align: left; color: white; } to #header #sitename \ {margin-top: 25px; } to #header #sitename to \ {color: white; text-decoration: none; font-size: 30px; font-weight: 900; } to #header form \ {margin-top: 15px; float: right; } to #header form li \ {font-size: 13px; margin-left: 15px; } to #header form li to \ {color: #A9BCF5; text-decoration: none; } to #header form input [type = " text?] \ {margin-top: 3px; margin-bottom: 3px; width: 150px; to border: 1px solid #08298A; height: 25px; padding-left: 3px; } to #header form input [type = " password?] \ {margin-top: 3px; margin-bottom: 3px; width: 150px; to border: 1px solid #08298A; height: 25px; padding-left: 3px; } to #header form input [type = " submit?] \ {height: 25px; margin-top: 20px; background-color: #084B8A; color: white; to border: 1px solid #08298A; } to #wrapper \ {margin: 0 car; padding: 0px; text-align: to center; width: 980px; } to #wrapper div \ {float: left; font-family: Helvetian, arial, sans-serif; } to #wrapper #div1 \ {margin-top: 30px; width: 590px; text-align: left; } to #wrapper #div1 p \ {font-size: 20px; font-family: arial; font-weight: bold; margin: 0px; color: #0e385f; } to #wrapper #div2 \ {margin-top: 10px; width: 390px; text-align: left; } to #wrapper #div2 h1 \ {margin: 0px; font-size: 37px; color: #2E2E2E; } to #wrapper #div2 p \ {font-size: 18px; color: #2E2E2E; } to #wrapper #div2 li \ {list-style-type: none; margin-top: 10px; } to #wrapper #div2 li #firstname \ {width: 49%; } to #wrapper #div2 li #surname \ {margin-left: 2%; width: 49%; } to #wrapper #div2 li input [type = " text?] \ {width: 100%; height: 40px; border-radius: 5px; padding-left: 10px; font-size: 18px; to border: 1px solid #BDBDBD; } to #wrapper #div2 li input [type = " password?] \ {width: 100%; height: 40px; border-radius: 5px; padding-left: 10px; font-size: 18px; to border: 1px solid #BDBDBD; } to #wrapper #div2 li select \ {padding: 4px; float: left; } to #wrapper #div2 li to \ {margin-left: 10px; width: 150px; color: #045FB4; text-decoration: none; font-size: 11px; display: inline-block; vertical-align: middle; line-height: 15px; } to #wrapper #div2 li a: to hover \ {text-decoration: underline; } to #wrapper #div2 li \ {color: #2E2E2E; font-size: 18px; } to #wrapper #div2 #terms \ {color: #424242; font-size: 11px; } to #wrapper #div2 #terms to \ {display: inline; margin: 0px; } to #wrapper #div2 li input [type = " submit?] \ {width: 205px; height: 45px; text-align: to center; font-size: 19px; margin-top: 10px; margin-bottom: 10px; font-family: ‘Freight Sans Bold’, Helvetian, arial, sans-serif! important; font-weight: bold! important; background: linear-gradient (#67ae55, #578843); background-color: #69a74e; box-shadow: inset 0 1px 1px #a4e388; border-color: #3b6e22 #3b6e22 #2c5115; to border: 1px solid; border-radius: 5px; color: #fff; cursor: to pointer; display: inline-block; position: relative; text-shadow: 0 1px 2px rgba (0.0.0,5); } to #wrapper #div2 #create_page \ {color: #424242; font-size: 13px; font-weight: bold; } to #wrapper #div2 #create_page to \ {display: inline; margin: 0px; font-size: 13px; } to #footer_wrapper \ {width: 100%; to clear: both; float: left; margin-top: 30px; min-width: 995px; background-color: white; text-align: left; } #footer1 \ {width: 980px; margin: 0px car; padding: 0px; border-bottom: 1px solid #E6E6E6; height: 30px; line-height: 30px; font-size: 12px; color: #848484; } #footer1 to \ {color: #365899; display: inline; margin-left: 10px; text-decoration: none; } #footer1 a: to hover \ {text-decoration: underline; } #footer2 \ {width: 980px; margin: 0px car; padding: 0px; font-size: 12px; color: #848484; } #footer2 to \ {color: #365899; display: inline-block; margin: 5px; margin-left: 0px; min-width: 80px; text-decoration: none; } #footer2 a: to hover \ {text-decoration: underline; }

These are the archives necessary to create a Web with design similar to home or page of beginning of facebook.

Source: talkerscode

To see demo