Home >Web Front-end >CSS Tutorial >How Can I Overlay a Transparent Div Over a YouTube iFrame?
Overlay Transparent Div over YouTube iFrame
While embedding YouTube videos using iFrames offers compatibility advantages, it poses a unique challenge when attempting to overlay a transparent div over the video. To resolve this issue, you can leverage the "wmode" GET parameter provided by YouTube.
Solution:
<iframe class="youtube-player" type="text/html" width="520" height="330" src="http://www.youtube.com/embed/NWHfY_lvKIQ?wmode=opaque" frameborder="0"></iframe>
Once these modifications are implemented, the overlay div will correctly appear over the opaque YouTube video.
The above is the detailed content of How Can I Overlay a Transparent Div Over a YouTube iFrame?. For more information, please follow other related articles on the PHP Chinese website!