I would like to know how I can centralize the chat.
<iframe src="https://www2.cbox.ws/box/?boxid=2392843&boxtag=uStqza"width="75%" height="450" allowtransparency="yes" frameborder="0" marginheight="0" marginwidth="0" scrolling="auto"></iframe>
I would like to know how I can centralize the chat.
<iframe src="https://www2.cbox.ws/box/?boxid=2392843&boxtag=uStqza"width="75%" height="450" allowtransparency="yes" frameborder="0" marginheight="0" marginwidth="0" scrolling="auto"></iframe>
Create a div , put the chat inside. In CSS you do:
#div
margin: 0 auto;
}
In JavaScript you do:
function centraliza(){
var div = document.getElemenById('div');
div.style.marginTop = (window.innerHeight / 2) - (div.offsetHeight / 2) + 'px';
}
centraliza();
"You put this function on the onload of the page and / or onresize too"
You can add style="margin: 0 auto; display: block;"
to iframe
:
<iframe style="margin: 0 auto; display: block;" src="https://www2.cbox.ws/box/?boxid=2392843&boxtag=uStqza"width="75%" height="450" allowtransparency="yes" frameborder="0" marginheight="0" marginwidth="0" scrolling="auto"></iframe>
Example:
<iframe style="margin: 0 auto; display: block;" src="https://www2.cbox.ws/box/?boxid=2392843&boxtag=uStqza"width="75%" height="450" allowtransparency="yes" frameborder="0" marginheight="0" marginwidth="0" scrolling="auto"></iframe>
Create a div or class and there in the css you put: example with class: no html:
<div class="chat">
<iframe src="https://www2.cbox.ws/box/?boxid=2392843&boxtag=uStqza"width="75%" height="450" allowtransparency="yes" frameborder="0" marginheight="0" marginwidth="0" scrolling="auto"></iframe>
</div>
no css:
.chat{
position: absolute;
left: 50%;
top: 50%;
}