align contents of a <div> in the center of the screen

Asked

Viewed 1,161 times

2

I have a loading and he’s in a <div>. Turns out he always shoots left and I’d like him to stay in the center of the page, but as it is in a <div>, I thought it might be this.

<asp:Content ID="Content3" ContentPlaceHolderID="head" runat="server">
    <div id="loading" style="align-content:center">        
        Carregando....
        <div><img src="../Imagens/wait2.gif" /></div>        
    </div>
</asp:Content>

1 answer

2


The correct is text-align:center

<asp:Content ID="Content3" ContentPlaceHolderID="head" runat="server">
    <div id="loading" style="text-align:center">        
        Carregando....
        <div><img src="../Imagens/wait2.gif" /></div>        
    </div>
</asp:Content>
  • I will mark your reply, but I did so and it did not function, but I went outside the localhost environment and it worked, but if I run on localhost(development) it does not even bother.

  • Still not working? See if this id loading has any text-align:left ! Mportant;. The only way an inline CSS won’t work is if you have some other element giving ! Important in the same property.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.