
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 max-width Property for Responsive Video Player
You can try to run the following code to use a max-width property to make your video player responsive −
Example
<!DOCTYPE html> <html> <head> <meta name = "viewport" content = "width=device-width, initial-scale = 1.0"> <style> video { max-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>
Advertisements