Skip to content
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

Remove explicit width and height #4

Open
prologic opened this issue Mar 26, 2023 · 1 comment
Open

Remove explicit width and height #4

prologic opened this issue Mar 26, 2023 · 1 comment

Comments

@prologic
Copy link

Please remove the explicit width and height attributes. Let CSS handle this.

@hugovdm
Copy link

hugovdm commented Sep 5, 2024

I believe the width and height attributes are explicit due to them being required by the YouTube API: https://developers.google.com/youtube/iframe_api_reference

I see fundipper went for passing the attribute values via parameters to a NewExtender constructor:https://github.com/fundipper/goldmark-videos

Some other interesting discussions around more responsive youtube embeds include this one:
https://stackoverflow.com/questions/35814653/automatic-height-when-embedding-a-youtube-video
These examples still contain the hard-coded width and height iframe attributes, but use CSS on an encapsulating div to get better behaviour.

  • My thought thus: perhaps just adding an encapsulating div would at least enable doing these useful things with the resulting HTML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants