Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm looking for a way to force all video content on my site to scale to 100% width and I'm hoping to avoid using any additional javascript.

Is there a filter or function that I can use to accomplish this? If so how is it used? And I do not want a plugin!

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Without knowing more information - you can use CSS to set a max width to any element.

iframe, object, embed {
    max-width:100%;
}

Rachel Baker mentioned Fitvids.JS in her WordCamp Chicago presentation last weekend. It is a Javascript plugin that writes specific code for the various video providers online.

Try the CSS solution and fall back to JS if you can't figure it out.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.