Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

135
Views
How to add the video tag with full width?

I want to append the video tag with full width in div that id is video using javascript. Could you help me?

let video = document.createElement("video")
video.width = 320;
video.height = 180;
video.style.background = "black"
document.getElementById("video").append(video);
<html>
    <body style="background: lightgrey">
        <div class="container">
            <div id="video"></div>
        </div>
    </body>
</html>

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

<video width="100%" height="auto" controls>
  <source src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" type="video/mp4">
  message if vodeo does not show
</video>

about 4 years ago · Juan Pablo Isaza Report

0

with

#video {
  width: 100%;
  height: auto;
}

in your css, the video will always use the full available width of its parent, in this case, of "container".

about 4 years ago · Juan Pablo Isaza Report

0

I think it's a comment, but I cannot comment, so I post it as an answer.

let video = document.createElement("video")
video.width = 320;
video.height = 180;
video.style.background = "black"
document.getElementById("video").append(video);
#video video {
    width: 100% !important;
}
<html>
    <body style="background: lightgrey">
        <div class="container">
            <div id="video"></div>
        </div>
    </body>
</html>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!