Click here to Skip to main content
15,918,243 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I position an mp4 video inside a modal window so that text in the modal window appears both above and below the video?

TEXT HERE BLAH BLAH BLAH BLAH

mp4 video here

MORE TEXT HERE BLAH BLAH

What I have tried:

HTML
<div id="modalwindow" style="display:none;">
    <center>
        <img src="modal-window.png" height="600" width="1050">
        <text color=black>
        <video controls autoplay>
            <source src="video.mp4" type="video/mp4">
        </video>
    </center>
</div>
Posted
Updated 18-Oct-16 4:37am
v6
Comments
beaubeau 7-Oct-16 8:29am    
Why is my "What I have tried" HTML lines been reduced from five lines to only three? My full "What I have tried" is not showing.
Richard Deeming 7-Oct-16 15:44pm    
You need to make sure your code block is properly HTML-encoded. If the editor doesn't do it for you, then you'll have to do it by hand.

* <&lt;
* >&gt;
* &&amp;
Richard Deeming 7-Oct-16 16:40pm    
I've updated your code formatting for you. You might want to check that nothing was lost - some of the HTML tags looked incomplete to me.

Hi,

Have you tried floating all elements to the left using CSS?

CSS
text {
    float: left;
    width: 100%;
}

video {
     float: left;
     margin: auto;
}


There is no set width for the video so I have used 100% as an example. I would always use some padding to frame the content in the modal, it just looks nicer. I have also noticed that you have a fixed width of 1050, this will not be responsive on smaller and larger screens.

Hope this helps!
 
Share this answer
 
v2
Thanks CanniDanny!
text {
float: left;
width: 100%;
}

video {
float: left;
margin-auto;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900