Home  >  Article  >  Web Front-end  >  CSS DIV image vertical center_html/css_WEB-ITnose

CSS DIV image vertical center_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:32:201007browse

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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn