Hello friends
I want to resize a youtube video in my site.
Is it possible?
Please help.
Thanks

Dani AI

Generated

Several replies (notably and ) correctly flagged the embed as the place to control size. That approach works for a fixed pixel player, but the object/embed code shown earlier is the Flash-era pattern. For modern blogs the recommended pattern is the iframe embed inside a fluid wrapper so the player scales with the column while keeping the correct aspect ratio.

A widely compatible technique (works in older browsers) is the CSS “intrinsic ratio” wrapper. Replace VIDEO_ID with the video identifier from YouTube’s embed URL.

<div class="video-wrap">
  <iframe src="https://www.youtube.com/embed/VIDEO_ID" title="Video" frameborder="0" loading="lazy"></iframe>
</div>

<style>
.video-wrap {
  position: relative;
  width: 100%;
  max-width: 800px; /* optional cap to match blog column */
  padding-bottom: 56.25%; /* 16:9 ratio (change to 75% for 4:3) */
  height: 0;
  overflow: hidden;
}
.video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
</style>

If the environment supports modern CSS, the aspect-ratio property simplifies this:

.video-wrap { width:100%; max-width:800px; aspect-ratio:16/9; }
.video-wrap iframe { width:100%; height:100%; border:0; }

Notes: match the wrapper ratio to the video (16:9 vs 4:3) to avoid stretching; use max-width to limit oversized players in wide layouts; add loading="lazy" to defer off-screen iframe loads. If the blog platform strips raw iframe tags, use the platform’s embed widget or a responsive-embed plugin (as suggested earlier by and ) so the iframe can be placed inside a responsive wrapper.

Recommended Answers

All 5 Replies

Hello friends
I want to resize a youtube video in my site.
Is it possible?
Please help.
Thanks

Well the basic HTML embed code looks something like

<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/VID-ID"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/VID-ID" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>

Replace the VID-ID parameter with the ID of your video and change the values in green to re size the player (Both the top and the bottom values need to be changed)
HTH,
Sam
P.S.
Admins: I didn't use HTML code tags because I couldn't colour them if i did =)

Member Avatar for Member #334542

Anyway you have to use the embed code of youtube so you can just change the width and height parameters according to your needs

Its better not to use any software for resizing video. Yes that's better to use embed code of youtube for exact size and wills.

Just go back to youtube and resize the video using the 'Embed' option.
Let me know if I can help you with any other blog related stuff.

Just change the width and height value in the embed code offered by YouTube. It's easy as ABC.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.