Vertically and horizontally centered dimension Adaptive Elements
Vertically and horizontally centered dimension Adaptive elements:
If the size of the child element is fixed, it is easier to set it to vertical and horizontal center, for details, refer to the Code section of css implementation div horizontal vertical center. If the size of the child element is not fixed, it is a bit difficult to set it to vertical center. Let's take a look at the code example below:
<! DOCTYPE html>
The Code implements what we want, but the disadvantage in the US is that it is not compatible with earlier versions of IE browsers. However, over time, earlier browsers can be used in large quantities after they exit the market, of course, JavaScript can be used to ensure compatibility with all browsers. For details, refer to the section on compatibility with the vertical and horizontal elements of all browsers.
Original address: http://www.51texiao.cn/HTML5jiaocheng/2015/0521/2140.html