Use width
and max-height
on the <video>
element:
/*CSS*/ video { width: 100%; max-height: 100%; }
<!-- HTML --> <div id="player-overlay"> <video> <source src="../static/video/10s.mp4" /> <source src="../static/video/10s.webm" type='video/webm; codecs="vp8, vorbis"' /> <source src="../static/video/10s.ogv" type='video/ogg; codecs="theora, vorbis"' /> </video> </div>
Run code snippetExpand snippet
Also, you’re missing a semicolon after background-color
. When absolutely positioning an element to fill the screen, I prefer to set top
, bottom
, left
, and right
instead of setting height
and width
.
Related Posts:
- How can I scroll to an element using jQuery?
- Bootstrap Dropdown menu is not working
- Change Background color (css property) using Jquery
- Set timeout for ajax (jQuery)
- Use images like checkboxes
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- Why is the jquery script not working?
- Refresh/reload the content in Div using jquery/ajax
- How to get height of div in px dimension
- How to display raw JSON data on a HTML page
- Why is jquery show() not working in example
- jQuery scrollTop() method not working
- How to use aria-expanded=”true” to change a css property
- How to set “style=display:none;” using jQuery’s attr method?
- Failed to load resource: the server responded with a status of 404 (Not Found)
- How to change CSS using jQuery?
- How to properly use jsPDF library
- How do I check whether a checkbox is checked in jQuery?
- ReferenceError: $ is not defined
- jQuery document.createElement equivalent?
- Pure JavaScript equivalent of jQuery’s $.ready() – how to call a function when the page/DOM is ready for it [duplicate]
- jQuery.click() vs onClick
- jQuery Get Selected Option From Dropdown
- Check if checkbox is checked with jQuery
- How can I get the data-id attribute?
- Check if checkbox is checked with jQuery
- What is the meaning of == $0 that is shown in inspect element of google chrome for the selected element [duplicate]
- Failed to load resource: net::ERR_FILE_NOT_FOUND loading json.js
- Get class name using jQuery
- Export html table data to Excel using JavaScript / JQuery is not working properly in chrome browser
- How to generate a simple popup using jQuery
- How does the data-toggle attribute work? (What’s its API?)
- Adding images to a Bootstrap Carousel with AJAX
- How to read xml file contents in jQuery and display in html elements?
- JavaScript Loading Screen while page loads
- Completely disable scrolling of webpage
- Bootstrap Dropdown menu is not working
- Setting background-image using jQuery CSS property
- Bootstrap Dropdown menu is not working
- Create table with jQuery – append
- How to convert selected HTML to Json?
- How to Open New window on every Click
- How can I select an element by name with jQuery?
- Full-screen iframe with a height of 100%
- jQuery disable/enable submit button
- Play an audio file using jQuery when a button is clicked
- How to move an element after another element using JS or jquery?
- Equivalent of jQuery .hide() to set visibility: hidden
- Jquery button click() function is not working
- TypeError: $(…).DataTable is not a function
- Change text on hover, then return to the previous text
- Textarea Auto height
- Play/pause HTML 5 video using JQuery
- Why is marquee deprecated and what is the best alternative?
- How do I check whether a checkbox is checked in jQuery?
- Print the contents of a DIV
- Embedding instagram webpage inside an iframe
- Set value to currency in
- SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
- HTML Entity Decode
- Retrieve the position (X,Y) of an HTML element
- Clearing my form inputs after submission
- Reload an iframe with jQuery
- How to scroll an HTML page to a given anchor
- Highlight a word with jQuery
- How do I refresh a DIV content?
- “Uncaught TypeError: a.indexOf is not a function” error when opening new foundation project
- how to display a div triggered by onclick event
- jQuery sort elements using data id
- FormData append not working
- getContext is not a function
- How to change the text of a label?
- Change an image with onclick()
- JavaScript – Count Number of Visitor for Website
- Creating Accordion Table with Bootstrap
- Using “×” word in html changes to ×
- Closing Bootstrap modal onclick
- Fire oninput event with jQuery
- Changing the selected option of an HTML Select element
- HTML anchor link – href and onclick both?
- How can I know which radio button is selected via jQuery?
- Positioning element at center of screen
- How to scroll to top of page with JavaScript/jQuery?
- Cannot read property ‘style’ of undefined — Uncaught Type Error
- How to make HTML element resizable using pure Javascript?
- WordPress Bootstrap Handburger Menu Wont Open
- Show post in slider
- Adding JavaScript to a WordPress website
- Adding a Calculator to a WordPress Page
- Putting custom html/js page into Elementor as it’s own block
- Add other class content with reference class value
- internal anchor links no longer working after upgrade
- Overriding inline !important CSS with Javscript code snippet with media query
- Can’t Listen to KeyDown in TInyMCE Iframe (jQuery) and Pass it to Parent HTML FORM
- Unable to use Datepicker in a table when inserting a row
- jQuery for Fade Preload Causes My Site Favicon to Disappear from Tab of Browser
- Hide CSS class only in single post pages
- Site images are fixed in front of my site content [closed]
- Possible jquery / library conflict in plugin usage
- Element works, but not on wordpress site [duplicate]