The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Replace JPG with MP4

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #281032

    I have two thumbnails on a page that, when clicked, open in a pop-up lightbox to see larger versions of the same image. So, for example, thumb-1.jpg opens violin.jpg, while thumb-2.jpg opens jump.jpg. This is the code:


    .link {
    width: 50%;
    margin-left: auto;
    margin-right: auto;


    Instead of opening larger images when a thumbnail is clicked, I would like to display a MP4 file with controls.

    Is that possible, please?


    It’s possible with JavaScript. Here’s a demo that loads a YouTube video (iframe embed code) into a modal popup but you can edit the HTML in the JS function so that it inserts your video markup instead of the iframe video embed markup.

    Note that the function is using the video src/address in the text link’s href attribute. You’d wrap the link around your thumbnail image instead of text.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.