Do you really think the center alignment is so simple that we're going to get a level now, after all, it's a little hard to play.
<div id= "hz_qxalert1_id" style= "position:fixed; top:0px; left:0px; right:0px; bottom:0px; z-index:999; Display:block; width:100%; height:100%; Background:rgba (0, 0, 0, 0.701961); " >
<div id= "Hz_qxalert1_id_next" style= "width:400px; height:203px; padding:0px 0px 20px; Position:absolute; top:248px; left:484px; z-index:500; BORDER:1PX solid RGB (22, 138, 187); border-radius:5px; Overflow:hidden; Display:block; Background:rgb (255, 255, 255); " >
<p style= "padding:0 0 0 28px;text-align:left; height:50px; line-height:50px; z-index:500; " > News Consultation </p>
<p class= "Alert_text" style= "height:80px; line-height:80px; Z-index:500;text-align:center; " > Will you cancel the consultation and confirm the cancellation? </p>
<button onclick= "Enterout ()" class= "Btn1" style= "z-index:500;height:30px; Outline:none;text-align:center;background: #168ABB; Border:0;color: #fff; border-radius:5px;width:89px;margin-left:185px; " > is </button>
<button class= "btn1" style= "height:30px; Outline:none;text-align:center;background: #168ABB; Border:0;color: #fff; border-radius:5px;width:89px; z-index:500; " > No </button>
</div>
</div>
Like this code pop-up Modal box, how to let the middle White Block center alignment, the code is as follows
Gets the width and height of the black matte layer
var modelwidth = $ (' #hz_qxalert1_id '). width ();
var modelheight= $ (' #hz_qxalert1_id '). Height ();
Gets the width and height of the Cancel consultation confirmation box
var alertwidth = $ (' #hz_qxalert1_id_next '). width ();
var alertheight= $ (' #hz_qxalert1_id_next '). Height ();
Make the Cancel consultation confirmation box centered relative to the modal box
Parent.document.getElementById (' Hz_qxalert1_id_next '). Style.left = (modelwidth-alertwidth)/2+ "px";
Parent.document.getElementById (' Hz_qxalert1_id_next '). Style.top = (modelheight-alertheight)/2+ "px";
Let the confirmation box for the canceled consultation show up.
document.getElementById (' Hz_qxalert1_id_next '). Style.display = "block";
JS Control Div Center Align