Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Kanishka's avatar

iframe

I want to add "align-items: flex-start" to the iframe body class but it can't do what I tried ways. If any suggestions for that?

		.video-view-2 {
			width: 100% !important;
			margin: 0 30px !important;
		 	white-space: pre-wrap;
						iframe {
   			 				width: 100% !important;
    						max-width: 900px;
    						margin: 0 auto;
    							.vp-center {
        						align-items: flex-start !important;
    }
}
.video {
    margin: 0 auto;
    width: 1119px;
    height: 718px;
}

}

0 likes
1 reply
jlrdw's avatar

You can try: https://www.w3schools.com/howto/howto_css_modals.asp

I have used it and placed an iframe or object. I modified example as needed.

I usually do this:

    <div>


        <div class="modal-content" id="myModal" title="this is a dialog">
            <span id="modalspan" class="close" onclick="closeModal()" >&times;</span>
            <iframe style="width: 98%; margin: auto;" id="thedialog" height="300"></iframe>
        </div>

    </div>

Just example. The object or iframe in a modal.

Maybe you could adjust your code as needed to something similar. Just suggestion.

Edit:

In my case there is no video, I show other data:

    function showBal()
    {
        var url = '<?php echo DIR . "check/balance"; ?>';
        var modal = document.getElementById("myModal");
        var span = document.getElementsByClassName("close")[0];
        myModal.style.display = "block";
        document.getElementById("thedialog").src = url;
        
    }

Closing:

    function closeModal()
    {
        document.getElementById("myModal").style.display = "none";
    }

But tweaking style and placement is a little trial and error.

Please or to participate in this conversation.