Home > Article > Web Front-end > CSS DIV image vertical center_html/css_WEB-ITnose
1.
To make the picture in the DIV vertically centered, in a standard browser, set display:table for the parent container; and set display:table-cell; for the child element, so that it can be vertically centered, as shown in the figure above.
2. When position: absolute, I originally thought that when top is not set, it is equivalent to top: 0px. But later I found that when it is not set, the element does not change its position.