- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Use CSS width property for a responsive video player
To make your video player responsive, use the width property and set it to 100%
Example
<!DOCTYPE html> <html> <head> <meta name = "viewport" content="width=device-width, initial-scale=1.0"> <style> video { width: 100%; height: auto; } </style> </head> <body> <video width = "300" controls autoplay> <source src = "/html5/foo.ogg" type = "video/ogg" /> <source src = "/html5/foo.mp4" type = "video/mp4" /> </video> <p>To check the effect, you need to resize the browser.</p> </body> </html>
- Related Articles
- Use CSS max-width property responsive for video player
- Use CSS width property for responsive image
- Use CSS max-width property for responsive image
- Creating a responsive Video Player using Video.js\n
- HTML DOM Video width Property
- CSS width property
- Setting up a Poster for a Video in Video.js Player
- CSS max-width property
- CSS min-width property
- CSS outline-width property
- Animate CSS width property
- Usage of width property with CSS
- Animate CSS border-left-width property
- Animate border-top-width CSS property
- The border-width Property in CSS

Advertisements