i'd like to put an image behind my youtube iframe. The image will act as a visual frame around the youtube window. I've tried different methods, but either both elements where placed after each other, or the iframe was positioned relative to the window size of the browser. Both elements will sit in a table. I want the youtube window to sit about in the center of the background image and nothing should put both elements apart (like changing the window size of the browser etc.) In addition it would be pretty nice to have a custom preview picture for the video instead of the youtube window until it gets clicked (and possible put the custom picture back in place when the youtube video has been watched).
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
- how to get selected text from iframe with javascri
Set
background-image
behind your Youtubeiframe
and use JavaScript for custom preview picture.TRY - DEMO
HTML:
CSS:
Have you already tried to have your youtube-iframe in a container and set the image as background-image of this container? Like this:
and css: