How to change default width parameter of embedded video in wordpress?

if you could make it to something like this:

<div class="videoWrapper">
    <iframe width="600" height="338" src="https://www.youtube.com/embed/f5CcOq8UzkI?feature=oembed" frameborder="0" allowfullscreen=""></iframe>
</div>

then responsive css for that would be like this:

.videoWrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    padding-top: 25px;
    height: 0;
}
.videoWrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

if you have no control on the markup, then what we can do is when you put that shortcode in the editor, add some div around it like this:

<div class="videoWrapper">
    
</div>

Leave a Comment