{"id":2574,"date":"2017-01-23T13:35:02","date_gmt":"2017-01-23T21:35:02","guid":{"rendered":"http:\/\/www.wellgolly.com\/?p=2574"},"modified":"2017-01-24T07:21:24","modified_gmt":"2017-01-24T15:21:24","slug":"centering-youtube-videos","status":"publish","type":"post","link":"https:\/\/www.wellgolly.com\/?p=2574","title":{"rendered":"Centering YouTube Videos"},"content":{"rendered":"<p>WordPress automatically displays YouTube videos when you put the shared link into a post. (Leave a blank line before and after the link.)<\/p>\n<p><iframe loading=\"lazy\" title=\"Bruiser and Bird\" width=\"660\" height=\"371\" src=\"https:\/\/www.youtube.com\/embed\/xnBAwUV7abA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>Sometimes you want to center the video and this code will do it.<br \/>\n<pre><code class=\"preserve-code-formatting\">\n&lt;iframe style=&#039;margin: 0 auto; display:block&#039; width=&#039;560&#039; height=&#039;315&#039; src=&#039;https:\/\/www.youtube.com\/embed\/xnBAwUV7abA&#039; frameborder=&#039;0&#039; allowfullscreen&gt;&lt;\/iframe&gt;\n&lt;p class=&#039;caption&#039;&gt;Bruiser and Bird&lt;\/p&gt;<\/code><\/pre><\/p>\n<p><iframe style='margin: 0 auto; display:block' width='560' height='315' src='https:\/\/www.youtube.com\/embed\/xnBAwUV7abA' frameborder='0' allowfullscreen><\/iframe><\/p>\n<p class='caption'>Bruiser and Bird<\/p>\n<p>If you use the centering trick, the video won\u2019t display in preview mode.<\/p>\n<p>You can have the video start at a specific location by appending the time to the link.<br \/>\n<pre><code class=\"preserve-code-formatting\">\nhttps:\/\/youtu.be\/xnBAwUV7abA?t=43s<\/code><\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress automatically displays YouTube videos when you put the shared link into a post. (Leave a blank line before and after the link.) Sometimes you want to center the video and this code will do it. &lt;iframe style=&#039;margin: 0 auto; display:block&#039; width=&#039;560&#039; height=&#039;315&#039; src=&#039;https:\/\/www.youtube.com\/embed\/xnBAwUV7abA&#039; frameborder=&#039;0&#039; allowfullscreen&gt;&lt;\/iframe&gt; &lt;p class=&#039;caption&#039;&gt;Bruiser and Bird&lt;\/p&gt; Bruiser and Bird If you &hellip; <a href=\"https:\/\/www.wellgolly.com\/?p=2574\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Centering YouTube Videos<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-2574","post","type-post","status-publish","format-standard","hentry","category-html-and-css"],"_links":{"self":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/2574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2574"}],"version-history":[{"count":0,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/2574\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}