Caramba, só hoje que parei pra pensar nisso tudo... É como se os dias fossem passando, as horas continuando, e eu ainda por aqui sem meio que fazer muita coisa....
É estranho, sim, mas ainda assim não passa de um teste.Update: I was asked to write an article for .Net Magazine on this topic.
The article is more depth, suggesting some alternatives for embedding responsive videos in your web designs. Check it out in issue # 247, available October 8th 2013.
I came across a small problem when adding a video from YouTube to one of my blog posts about the Childish Gambino website. Since this website is fully “responsive”, I needed the YouTube video to re-size depending on the browser size or device width. But when I added the embed code, the video had a fixed height and width. No!!
This looked fine on desktop computers, but pretty much broke the design when viewing on a mobile device. We needed a responsive YouTube embed code. You would think that videos that have 100% width set would automatically just resize to the surrounding container. Well, thats is not the case.
The fix was actually quite simple, and here is how.
You will need to wrap the responsive youtube embed code with a
and specify a 50% to 60% padding bottom. Then specify the child elements (iframe, object embed) 100% width, 100% height, with absolute position. This will force the embed elements to expand fullwidth automatically. Awesome! Exactly what we need.
Comentários
Postar um comentário