How To Make iframe's Responsive (YouTube Embeds, Google Maps etc.)

  Рет қаралды 76,413

Paper Krane

Paper Krane

Күн бұрын

Пікірлер: 83
@decipheroffair6979
@decipheroffair6979 4 жыл бұрын
Just did this for youTube iFrames embedded in a Wordpress themes. It worked first time, thank you! Just wanted you to know how much I value people like you sharing your knowledge on here. Best wishes
@DanielAttila
@DanielAttila 6 жыл бұрын
Absolute genius. The doesn't scale proportionately, but the DIV does. Thanks very much.
@davidtorres5795
@davidtorres5795 3 жыл бұрын
I have been searching this for months. Thank you!!!
@barkbarkatthemoon
@barkbarkatthemoon 6 жыл бұрын
This works great but you have to wrap this in yet another if you want to scale its size because you can't change the 100% values and still have no blank space below it.
@pauldavy1450
@pauldavy1450 6 жыл бұрын
been looking for this kind of fix for a long time! and explained so clearly it to seconds to understand. thank you :)
@GracefulEmbroidery
@GracefulEmbroidery 2 жыл бұрын
Very clear. Thank you. How can I set a mix-width for this so it stays at the 560 pxs on a PC?
@reedyma
@reedyma 2 жыл бұрын
Thank you so much my man! I was stuck on a problem and you walked me right through the solution. Adding the understanding section, thank you for that too, it let's a user learn instead of just being a copy paste script jobber.
@onorosaurosrex
@onorosaurosrex 2 жыл бұрын
well Krane, you made my day, all the best wishes.
@mayrarincones8427
@mayrarincones8427 4 жыл бұрын
thank you so muuuch!!! I've been struggling with this for hours!!
@ACEinOZ
@ACEinOZ 2 жыл бұрын
I want to make a two column Iframe webpage, with links in the left column opening in the right column, and any help to find the code so I can do that would be appreciated.
@Zuldria
@Zuldria 3 жыл бұрын
Thank you, sir. I was having trouble with having it work with my mobile layout and this video solved my problem. 🤓♥
@wisdomtomato7331
@wisdomtomato7331 2 жыл бұрын
OMG, you are incredible, that's exactly what i was looking for
@calebrunion
@calebrunion 4 жыл бұрын
Thanks for the video, very helpful. The text editor font-size is pretty small. It would be easier to follow if it was larger.
@livingyearsmotivation
@livingyearsmotivation 2 жыл бұрын
Thanks, can you share a solution for pdfs? This doesn't work with pdfs in s.
@radar_raps
@radar_raps 4 жыл бұрын
How would we make it centered?
@MemorizeAndLearn
@MemorizeAndLearn 6 жыл бұрын
Thank you! Solved the problem with an easy solution. Many of the other solutions out there are not great. Much appreciated.
@christophergarces5708
@christophergarces5708 6 жыл бұрын
Thanks man, but how do you remove that white space at the top of the embeded video?
@Zaq150
@Zaq150 7 жыл бұрын
but how to do such height set to its content???
@tennisfitapp
@tennisfitapp 5 жыл бұрын
hey, I tried this in Teachable platform and just won't work, any suggestion why? thanks alot!
@GoodGuy374
@GoodGuy374 5 жыл бұрын
ok.. so how do we make this work on css-grid? if I have sidebar on left and content on right, footer in the bottom.. it goes out of grid when I put embedded video in content grid.
@PaisleyCanada
@PaisleyCanada 7 жыл бұрын
Whoa. I never thought a child element would fill the *padding* area of a parent, but I'm guessing this is due to the relative/absolute positioning. Nice trick!
@GregDavidsAus
@GregDavidsAus 6 жыл бұрын
"Original article" link is not working. 404 error. Might want to fix that? Cheers
@nishmamaskey1093
@nishmamaskey1093 4 жыл бұрын
still the same.
@seppneimusser5723
@seppneimusser5723 2 жыл бұрын
What's about id="main-doc-body" ... ?
@thetowerfantasymusic
@thetowerfantasymusic 3 жыл бұрын
Thx, works as of August 2021. I'm doing a React app and it's perfect.
@werewolf5
@werewolf5 3 жыл бұрын
I needed this for a webflow client, thank you so damn much.
@bagusrahmat69
@bagusrahmat69 6 жыл бұрын
does it work properly on iPhone?
@segsfault
@segsfault 3 жыл бұрын
To get your Aspect Ratio Percentage Use This Formula Ratio = a:b Percentage = b/a*100 = your% Example - Ratio = 4:3 Percentage = 3/4*100 = 75%
@kinnyvergara9419
@kinnyvergara9419 6 жыл бұрын
realy thanks from colombia. this has been the best solution for me. thanks. sorry for my bad english
@PaperKrane
@PaperKrane 6 жыл бұрын
No apologies necessary! Thank you for taking the time to write / watch!
@mgr5550
@mgr5550 5 жыл бұрын
Does anyone here know if we can use this code within an Adobe Muse webpage project ? I put in this code into and Object > Insert HTML and it didnt show any responsiveness.
@SarojKumar-bq3cd
@SarojKumar-bq3cd 4 жыл бұрын
yes the video is responsive but the problem is that video is appering very big in size. if we fix height and width then video become no more responsive how to fix this issue. please help me to get out of this.
@PaperKrane
@PaperKrane 4 жыл бұрын
You need to define the parent elements size of the video.
@SarojKumar-bq3cd
@SarojKumar-bq3cd 4 жыл бұрын
@@PaperKrane thank you it works😊
@sammynite2940
@sammynite2940 4 жыл бұрын
You made my day! So happy!
@kevinmorin-kensicki364
@kevinmorin-kensicki364 8 жыл бұрын
Thanks for the vid. I did what you stated in the video to make my google calendar responsive. When I resized my browser on my computer as you did in the video, it worked fine. However when I uploaded to my server and looked at it on my iphone 5s, it still cut off the Friday and Saturday columns of the calendar. I my larger iphone 6s, it cut off the Saturday column. But thanks again for the video. I found your explanations very helpful.
@itech40
@itech40 6 жыл бұрын
So I understand what happens, I did it and it works, so thanks a lot man! BUT, I'm not sure I understand of the trick works from A to Z. You're awesome bro
@jonnyspade
@jonnyspade 6 жыл бұрын
I tried this in adobe muse, once I hit my first master page breakpoint, many aspect of the site disappear. Any advice?
@the1socialmediadivafloyd470
@the1socialmediadivafloyd470 3 жыл бұрын
i need to play vertical videos on my webpage without the black bars from a 16:9 frame
@tauhided1861
@tauhided1861 6 жыл бұрын
how about making the font size far more smaller?
@PaperKrane
@PaperKrane 6 жыл бұрын
Will make sure to do this just for you next time.
@marioalejandroguzmanberroa8327
@marioalejandroguzmanberroa8327 6 жыл бұрын
Hello, thanks for share your knowledge. Bro i have a question: this implementation works fine with other type of url? Like other html page? Thanks for your support, regards!!
@Hiker97
@Hiker97 2 жыл бұрын
Thanks, worked great!
@Rebecca-sv3vd
@Rebecca-sv3vd 6 жыл бұрын
I cannot read the code you are writing on the screen, can you copy your code into the comments section?
@PaperKrane
@PaperKrane 6 жыл бұрын
Essentially it is: With Styles such as: .video-container{ width:100%; height: 0px; padding-bottom: 56.25%; position: relative; } .video-container { position: absolute; width: 100%; height: 100%; }
@bradchellingworth5973
@bradchellingworth5973 3 жыл бұрын
Would be nice to see a solution that doesn't require you to specify the padding-bottom as this only works for that aspect ratio. For example, if you are building a blog and users can enter their own content they might add s from anywhere not just youtube.
@PaperKrane
@PaperKrane 3 жыл бұрын
You could write a small script (JavaScript) that detects/parses common embed sources (ie KZbin, SoundCloud, TikTok etc) and then adjust the padding dynamically. For example set the padding bottom to 177% for TikTok videos that are 9x16, 100% for SoundCloud then have a typical 56.25% fallback. I understand not wanting to specify the padding but s still don’t play well with responsiveness.
@the_sophile
@the_sophile Жыл бұрын
divide the height by width and multiply by 100 to get the padding percentage. For example if the aspect ratio is 16:9, the padding percent is 9/16*100 = 56.25% as mentioned in the video.
@KivaGordon
@KivaGordon 5 жыл бұрын
It didn't work for my KZbin any reason why?
@PaperKrane
@PaperKrane 5 жыл бұрын
Kiva Gordon hmm. Mind sharing your code snippet you used?
@patzmusic
@patzmusic 6 жыл бұрын
Thank you so much!! you made my day!
@Littlemouse_
@Littlemouse_ 4 жыл бұрын
So this doesn't work if you have an created on your laptop :/
@PaperKrane
@PaperKrane 4 жыл бұрын
s aren’t device specific unless you are using an old browser. Can you please specify the issue?
@irvingminguer5436
@irvingminguer5436 4 жыл бұрын
Muchs gracias hermano, me ayudaste demasiado!!
@goEnglishTalkZone
@goEnglishTalkZone Жыл бұрын
Thank you, bro🤗
@akuamtau
@akuamtau 3 жыл бұрын
very helpful thanks for this!
@machadoviewer
@machadoviewer 6 жыл бұрын
Thank you pal. It helped me a lot!
@ikram1125
@ikram1125 6 жыл бұрын
Excellent bro...........
@cefbanquetfiles3317
@cefbanquetfiles3317 4 жыл бұрын
thank you for this tutorial!
@DashaG182
@DashaG182 4 жыл бұрын
Awesome! Thanks a lot
@jenniferswift6491
@jenniferswift6491 Жыл бұрын
Thank you!
@artizon_j
@artizon_j 3 жыл бұрын
Thank you very much!
@oneanime9897
@oneanime9897 2 жыл бұрын
Source code please
@joebiggs7054
@joebiggs7054 6 жыл бұрын
I love videos where the resolution is so shitty you cant read any of the text. Brilliant.
@PaperKrane
@PaperKrane 6 жыл бұрын
Joe Biggs maybe check your is bandwidth. It is in HD.
@joebiggs7054
@joebiggs7054 6 жыл бұрын
Im pulling 256mbps. Idk why i cant adjust it then.
@PaperKrane
@PaperKrane 6 жыл бұрын
That is really strange. Don't know what it could be.
@vaibhavblayer
@vaibhavblayer 7 жыл бұрын
thankyou, it helped me a lot
@kevinblakely4384
@kevinblakely4384 6 жыл бұрын
I love you !!!!!!!! Thanks
@CarlosYounes
@CarlosYounes 2 жыл бұрын
BRAVO! THANKS! Best Regards. :)
@manjunathkottarki1092
@manjunathkottarki1092 4 жыл бұрын
it wont work....
@СергійЩербина-г4щ
@СергійЩербина-г4щ 6 жыл бұрын
it works, thanks
@Lucao477
@Lucao477 3 жыл бұрын
Thanks a lot
@paladintaekwon-do4953
@paladintaekwon-do4953 5 жыл бұрын
didnt work in joomla
@ArtfulUI
@ArtfulUI 8 жыл бұрын
thank you!
@김미슉-m1e
@김미슉-m1e 6 жыл бұрын
Thanks
@Usamakhan-ic5ft
@Usamakhan-ic5ft 6 жыл бұрын
thanks bro
@trenton9
@trenton9 2 жыл бұрын
I'm shook.
@eliuespinoza4016
@eliuespinoza4016 5 жыл бұрын
Wasting time!. My link a photo gallery design from a table in mysql
@cleanandquick7051
@cleanandquick7051 5 жыл бұрын
KZbin embeds are easy with wordpress.
@needlesky
@needlesky 8 жыл бұрын
Thanks a lot.
Award Winning Animation With Only 20 Lines Of CSS?
6:59
Hyperplexed
Рет қаралды 1,9 МЛН
HTML5 and CSS3 Responsive design with media queries
15:58
Quentin Watt Tutorials
Рет қаралды 684 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
What Is an iFrame? (And How to Use Them)
3:56
Elegant Themes
Рет қаралды 225 М.
CSS Trick: How to make an embedded iframe responsive?
3:50
Hasan Armstrong
Рет қаралды 20 М.
Before and After pseudo elements explained - part one: how they work
9:08
How to Automatically Resize an iFrame (Using iFrameResize.js)
9:40
Flexbox CSS In 20 Minutes
19:59
Traversy Media
Рет қаралды 1,8 МЛН
10 CSS Pro Tips - Code this, NOT that!
9:39
Fireship
Рет қаралды 2,2 МЛН
Embed Responsive Videos with YouTube iframe and Video Tag
6:51
Six Minutes. Smarter.
Рет қаралды 9 М.
5 simple tips to making responsive layouts the easy way
15:54
Kevin Powell
Рет қаралды 783 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН