在 Docusaurus 中嵌入一个占 100% 宽度的视频
Embed a video into Docusaurus that occupies 100% of the width
我正在建设 a website by V2 Docusaurus。
我想在页面中嵌入 YouTube 视频。我希望框架的宽度为页面的 100%
。我尝试了很多解决方案,但没有找到完美的解决方案。目前,我正在使用以下代码:
<iframe width="675" height="380" src="https://www.youtube.com/embed/_AQXQDjw7Y8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
它在桌面上运行良好,但我意识到它在 phone 上运行不佳:
有人知道吗?
不是 Docusaurus 特有的问题。
<iframe width="675" ... />
您硬编码的宽度值大于大多数移动设备的宽度,因此这是预料之中的。看看 Flux docs does it in https://github.com/facebook/flux/blob/master/docs/In-Depth-Overview.md.
我正在建设 a website by V2 Docusaurus。
我想在页面中嵌入 YouTube 视频。我希望框架的宽度为页面的 100%
。我尝试了很多解决方案,但没有找到完美的解决方案。目前,我正在使用以下代码:
<iframe width="675" height="380" src="https://www.youtube.com/embed/_AQXQDjw7Y8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
它在桌面上运行良好,但我意识到它在 phone 上运行不佳:
有人知道吗?
不是 Docusaurus 特有的问题。
<iframe width="675" ... />
您硬编码的宽度值大于大多数移动设备的宽度,因此这是预料之中的。看看 Flux docs does it in https://github.com/facebook/flux/blob/master/docs/In-Depth-Overview.md.