htmlHow to center the form: First add a parent tag fa outside the form; then add a class centered to the form, the code is [ The operating environment of this tutorial: windows7 system, html5 version, DELL G3 computer, this method is suitable for All brands of computers. htmlMethods to center the form: When the width and height of the form are not fixed, add a parent tag fa outside the form, and add a class centered to the form After clearing the default style of the page (margin padding) html,body{width: 100%;height: 100%;} .fa {text-align: center;height: 100%;} .fa:before {content: '';display: inline-block;height: 100%;vertical-align: middle;} .centered {display: inline-block;vertical-align: middle;background: red;width: auto;} Related learning recommendations: html tutorial