Shrink a YouTube video to responsive width -


i have youtube video embedded on our website , when shrink screen tablet or phone sizes stops shrinking @ around 560px in width. standard youtube videos or there can add code make go smaller?

you can make youtube videos responsive css. wrap iframe in div class of "videowrapper" , apply following styles:

.videowrapper {     float: none;     clear: both;     width: 100%;     position: relative;     padding-bottom: 56.25%;     padding-top: 25px;     height: 0; } .videowrapper iframe {     position: absolute;     top: 0;     left: 0;     width: 100%;     height: 100%; } 

the .videowrapper div should inside responsive element. padding on .videowrapper necessary keep video collapsing. may have tweak numbers depending upon layout.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -