Align content in the middle of the web page

Some time we need to align content in the middle of the web page, mostly in the search, login, forget password pages. below CSS code in the body tag will help to align center the screen and also adjust when increase or decrease the screen size.