FitVids for WordPress
[resolved] Set a max width? (5 posts)

  1. GoldFlux
    Posted 3 years ago #

    This plug works great. Only thing is that the videos literally take up the full width of the post. Any way to set a max width?


  2. GoldFlux
    Posted 3 years ago #

    Actually this didn't work. It messed with the video's proportions.

    It's okay. I used this and it works ...

    div.post-body p object {
    	max-width: 70%;
    	padding: 0;
  3. Kevin Dees
    Plugin Author

    Posted 3 years ago #

    css is the solution for sure.

  4. Buovjaga
    Posted 2 years ago #

    Here's a pull request with this type of functionality: https://github.com/davatron5000/FitVids.js/pull/19
    I took the latest commit and replaced the plugin js with it (note it has a maxWidthDefault parameter).

  5. Chad Warner
    Posted 2 years ago #

    You can set a max-width for the container. For example, on a page of videos, you could use

    .post-12 .entry-content {
        max-width: 500px; /* set explicit width of container, because fitvids makes videos 100% width */

    If you can't do that because the videos are mixed with other content, this CSS gets pretty close. In this example, I want my videos to have a max-width of 500px and max-height of 281px, but you can change these to the sizes you want.

    .fluid-width-video-wrapper { /* fitvids */
        padding-top: 281px !important; /* override fitvids-generated padding; too much padding at full size */
    .fluid-width-video-wrapper iframe { /* fitvids */
        max-width: 500px; /* prevent videos from stretching too wide */
        max-height: 281px;

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • FitVids for WordPress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic