<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>wordpress css - WP2X</title> <atom:link href="https://wp2x.com/tag/wordpress-css/feed/" rel="self" type="application/rss+xml" /><link>https://wp2x.com</link> <description>We can help your Wordpress faster</description> <lastBuildDate>Tue, 28 Oct 2014 06:12:08 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod> hourly </sy:updatePeriod> <sy:updateFrequency> 1 </sy:updateFrequency> <generator>https://wordpress.org/?v=5.6.16</generator> <item><title>Full width 100% for youtube video iframe</title><link>https://wp2x.com/full-width-100-youtube-video-iframe/</link> <comments>https://wp2x.com/full-width-100-youtube-video-iframe/#comments</comments> <dc:creator><![CDATA[david]]></dc:creator> <pubDate>Tue, 28 Oct 2014 06:12:08 +0000</pubDate> <category><![CDATA[HTML/JavaScript/CSS]]></category> <category><![CDATA[Wordpress Tips]]></category> <category><![CDATA[html]]></category> <category><![CDATA[html5]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[wordpress css]]></category> <category><![CDATA[wordpress html]]></category> <category><![CDATA[wordpress js]]></category> <category><![CDATA[wordpress tips]]></category> <guid
isPermaLink="false">http://wp2x.com/?p=312</guid><description><![CDATA[<p>Today I will share you the issue what take me entire of day to solve about Full width 100% for youtube video iframe. Hope it will save your time. If you meet this issue, I believe it just take you 5 minutes to finish the task. &#160; There are 2 ways to solve this issue 1. ...</p><p>The post <a
rel="nofollow" href="https://wp2x.com/full-width-100-youtube-video-iframe/">Full width 100% for youtube video iframe</a> appeared first on <a
rel="nofollow" href="https://wp2x.com">WP2X</a>.</p> ]]></description> <content:encoded><![CDATA[<p>Today I will share you the issue what take me entire of day to solve about Full width 100% for youtube video iframe. Hope it will save your time. If you meet this issue, I believe it just take you 5 minutes to finish the task.<span
id="more-312"></span></p><p><a
href="http://wp2x.com/wp-content/uploads/2014/10/video-full-width.png?4b2a2c&amp;4b2a2c"><img
loading="lazy" class="aligncenter size-full wp-image-313" src="http://wp2x.com/wp-content/uploads/2014/10/video-full-width.png?4b2a2c&amp;4b2a2c" alt="video-full-width" width="660" height="284" srcset="https://wp2x.com/wp-content/uploads/2014/10/video-full-width.png 660w, https://wp2x.com/wp-content/uploads/2014/10/video-full-width-300x129.png 300w" sizes="(max-width: 660px) 100vw, 660px" /></a></p><p>&nbsp;</p><p>There are 2 ways to solve this issue</p><p>1. Javascript to make Full width 100% iframe/embed</p><p>Simple add this jQuery code</p><pre class="lang:js decode:true ">// Find all YouTube videos
var $allVideos = $("iframe[src^='http://www.youtube.com']"),

    // The element that is fluid width
    $fluidEl = $("body");

// Figure out and save aspect ratio for each video
$allVideos.each(function() {

  $(this)
    .data('aspectRatio', this.height / this.width)

    // and remove the hard coded width/height
    .removeAttr('height')
    .removeAttr('width');

});

// When the window is resized
$(window).resize(function() {

  var newWidth = $fluidEl.width();

  // Resize all videos according to their own aspect ratio
  $allVideos.each(function() {

    var $el = $(this);
    $el
      .width(newWidth)
      .height(newWidth * $el.data('aspectRatio'));

  });

// Kick off one resize to fix all videos on page load
}).resize();</pre><p>Now, reload the page and see the magic.</p><p>2. CSS to make Full width 100% iframe/embed</p><p>Much more simple, you can apply this css tips and the result will be the same.</p><pre class="lang:css decode:true">.videoWrapper {
	position: relative;
	padding-bottom: 56.25%; /* 16:9 */
	padding-top: 25px;
	height: 0;
}
.videoWrapper object,
.videoWrapper embed,  {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}</pre><p>Remember add class videoWrapper out of your video then the video inside this class will be display 100%.</p><p>Now, enjoy the result and welcome any comment.</p><p>The post <a
rel="nofollow" href="https://wp2x.com/full-width-100-youtube-video-iframe/">Full width 100% for youtube video iframe</a> appeared first on <a
rel="nofollow" href="https://wp2x.com">WP2X</a>.</p> ]]></content:encoded> <wfw:commentRss>https://wp2x.com/full-width-100-youtube-video-iframe/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>