-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to make the Iframe responsive? #242
Comments
It could be implemented by using .youtubeContainer {
position: relative;
width: 100%;
height: 0;
padding-bottom: 56.25%;
overflow: hidden;
margin-bottom: 50px;
}
.youtubeContainer iframe {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
} <YouTube videoId="2g811Eo7K8U" containerClassName={"youtubeContainer"} /> |
@redshoga Thank you for taking the time to answer my question! |
@redshoga got a real good solution for this component. CSS solution rocks! |
@josuablejeru , is this issue ready to be closed? |
@MichaelDimmitt the comment above from @redshoga works as expected. This issue is style related and doesn't concern YouTube Player API. |
@redshoga your css solution works great, thanks!! |
|
try |
Responsive Iframe
Hi first I want to thank you for your work, it has really an easy api to work with!
Here my question:
I had a really hard time try to make the iframe responsive on mobile and desktop. Did anyone have an Idea how we could implement a autoresize feature to this Component so you can make it responsive by a prop?
(If it is not possible... can anyone give me a hint how to make my iframe responsive in a material-ui card?)
Thanks for your time!
The text was updated successfully, but these errors were encountered: