This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is the technique I use to defer Youtube videos, when optimising the performance of WordPress site. | |
(1) Replace Youtube iFrame embed code with the below one: | |
---------------------- | |
<div class="dcg-responsive-container"> | |
<iframe class="dcg-responsive-iframe" src="" data-src="https://www.youtube.com/watch?v=nEFZLFyZNcE?rel=0" frameborder="0" allowfullscreen style="border:0"></iframe> | |
</div> | |
(2) Add the following CSS element (stylesheet element that will make Youtube iFrame Responsive) (style.css?): |
OlderNewer