I'm trying to center align a <p>
vertically and horizontally inside a <div>
. I'm creating a loading div to be used when I upload big files.
Here are my CSS styles:
#divProcessing {
position:absolute; /* or fixed */
background-color:rgba(0,0,0,0.6); /* to your preference */
width:100%;
height:100%;
top:0; left:0; bottom:0; right:0; /* not always necessary */
text-align:center;
vertical-align:middle;
};
* {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
};
And this is the HTML:
<div id="divProcessing">
<p>Cargando códigos, por favor espere . . . <img src="~/Content/images/ripple.gif"></p>
</div>
I have tried with text-align:center;
and vertical-align:middle;
but it still shows it at the top of the page.
Any idea about how to fix it?
JSFiddle: https://jsfiddle.net/VansFannel/nkb1zupr/
I have tried these answers: https://stackoverflow.com/a/19599207/68571, https://stackoverflow.com/a/20267769/68571 and https://stackoverflow.com/a/15121442/68571 without success.
` is centered inside the `