Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter GoldFlux

    (@goldflux)

    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;
    }
    Plugin Author Kevin Dees

    (@kevindees)

    css is the solution for sure.

    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).

    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;
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: FitVids for WordPress] Set a max width?’ is closed to new replies.