Embedded videos can sometimes take over your Knowledge Base articles by automatically resizing to fill available space πͺ
Here's how to keep your video embeds at exactly the size you want using our simple CSS class.
Why Control Video Size?
When you embed videos from platforms like YouTube or Vimeo, your Knowledge Base automatically resizes them to fill the width of the article. Sometimes that's not what you want for your articles.
The
noresize class lets you maintain precise control over your embedded video dimensions without any complicated CSS or coding.Adding the noresize Class
Here's how to keep your video embeds at a fixed size:
- Get your video embed code from YouTube, Vimeo, or another video platform
- Locate the iframe element in the embed code
- Add
class="noresize"to the iframe tag, and set the width and height attributes to the size you want - Insert the video by embed code as normal
The class goes in the embed code, so it can't be added to a video you insert by its URL. A fixed-size video still can't be wider than the article: anything wider gets capped at the article's width.
Example Code
<iframe class="noresize" width="280" height="157" src="VIDEO-URL" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen=""></iframe>