Mobile app version of vmapp.org
Login or Join
Voss6371140

: Right css code to align(center) the div tag? I googled this question and searched for an hour, every one specify their own likes, but i want to know the correct code to align the div in

@Voss6371140

Posted in: #Css

I googled this question and searched for an hour, every one specify their own likes, but i want to know the correct code to align the div in center position.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Voss6371140

1 Comments

Sorted by latest first Latest Oldest Best

 

@Welton168

ok if you give your div an id of #centerdiv , the following css should center it
#centerdiv { margin: 0 auto; }


be aware that you will have to give that div a width value as well

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme