Quantcast
Viewing all articles
Browse latest Browse all 86170

Re: Youtube video doesn't look right from a smartphone.

Validate code and fix reported errors.  You have a <script> between your closing </head> and opening <body> tag.  Scripts should be moved up into the <head> region or down just above the closing </body> tag.

http://validator.w3.org/

 

 

It's not clear to me if you want a responsive YouTube video or not.  Below is an example.

Alt-Web :: Fluid Grid Test

 

The relevant CSS code is this:

 

.video-container {

  position: relative;
  padding-bottom: 56.25%;
  padding-top: 30px; height: 0; overflow: hidden;
}

.video-container iframe,
.video-container object,
.video-container embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

 

And the HTML is this:

 

<div class="video-container">

<!--YOUTUBE CODE-->

<iframe width="560" height="315" src="http://www.youtube.com/embed/YOUR_VIDEO_ID" frameborder="0" allowfullscreen></iframe>

<!--end video-container--></div>

 

 

Nancy O.


Viewing all articles
Browse latest Browse all 86170

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>