-
Hajipur, Bihar, 844101
<video>
Tag?The <video>
tag in HTML is used to embed video files in a webpage. It supports multiple video formats and allows users to play, pause, control volume, and more.
<video width="640" height="360" controls>
<source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<video>
Attribute | Description |
---|---|
src |
Specifies the video file path |
controls |
Displays play, pause, volume, etc. controls |
autoplay |
Automatically plays the video on load |
muted |
Starts video with no sound |
loop |
Repeats the video when it ends |
poster |
Sets a placeholder image before playing |
preload |
Hints if video should be loaded on page load |
<video width="500" height="300" controls autoplay muted loop poster="thumbnail.jpg">
<source src="video.mp4" type="video/mp4">
<source src="video.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
Format | Type | Browser Support |
---|---|---|
.mp4 |
video/mp4 |
✅ Widely supported |
.webm |
video/webm |
✅ Modern browsers |
.ogg |
video/ogg |
✅ Firefox, Opera |
<video controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
This improves compatibility across browsers.
<style>
video {
border: 2px solid #333;
border-radius: 10px;
}
</style>
Q1. Embed a video file named intro.mp4
using the <video>
tag.
Q2. Add controls
to let users play and pause the video.
Q3. Make the video autoplay, muted, and loop.
Q4. Add a poster image called thumbnail.jpg
.
Q5. Provide fallback text for browsers that don’t support video.
Q6. Embed a .webm
and .mp4
version of the same video.
Q7. Set video dimensions to 640x360 pixels.
Q8. Use CSS to round the corners of the video player.
Q9. Create a responsive video using max-width: 100%
.
Q10. Embed multiple videos on one page with different posters.
Q1: Which HTML tag is used to display videos on a webpage?
Q2: What does the controls attribute do?
Q3: Which attribute lets a video start playing automatically?
Q4: Which video format is most widely supported in browsers?
Q5: Which attribute shows an image before the video plays?
Q6: What happens if the browser doesn't support the <video> tag?
Q7: What does the muted attribute do?
Q8: Which attribute makes the video repeat continuously?
Q9: Which tag is used to specify the video file inside the <video> tag?
Q10: Which CSS property makes the video responsive?