Title: Customizing mejs video container
Last modified: August 21, 2016

---

# Customizing mejs video container

 *  [naenara](https://wordpress.org/support/users/naenara/)
 * (@naenara)
 * [12 years ago](https://wordpress.org/support/topic/customizing-mejs-video-container/)
 * Hey there,
 * I’ve been trying to set up a fitting layout for posting .webm and .mp4 videos
   on my blog. After some googling I found the following:
 *     ```
       .mejs-container {
         width: 100% !important;
         height: auto !important;
         padding-top: 57%;
       }
       .mejs-overlay, .mejs-poster {
         width: 100% !important;
         height: 100% !important;
       }
       .mejs-mediaelement video {
         position: absolute;
         top: 0; left: 0; right: 0; bottom: 0;
         width: 100% !important;
         height: 100% !important;
       }
       ```
   
 * I wanted to increase the width of the videos from the default 474×270 to something
   larger, but it didn’t quite work as intended.
    [http://i.imgur.com/vOuOFNT.jpg](http://i.imgur.com/vOuOFNT.jpg)
 * The height is set to auto, so I don’t know why it doesn’t increase as well. Setting
   the height manually works obviously, but not all videos are 16:9.
 * Any ideas on how to set the height according to width while keeping the aspect
   ratio?

The topic ‘Customizing mejs video container’ is closed to new replies.

## Tags

 * [html5](https://wordpress.org/support/topic-tag/html5/)
 * [video](https://wordpress.org/support/topic-tag/video/)
 * [webm](https://wordpress.org/support/topic-tag/webm/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [naenara](https://wordpress.org/support/users/naenara/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/customizing-mejs-video-container/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
