Home >Web Front-end >HTML Tutorial >Pure CSS implements DIV and image horizontal and vertical centering, compatible with multiple browsers (implementation process)_html/css_WEB-ITnose

Pure CSS implements DIV and image horizontal and vertical centering, compatible with multiple browsers (implementation process)_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-24 12:27:15943browse

" -//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Untitled Document






Possible situation 2.





Untitled Document








2. Implement vertical centering in IE




Untitled Document







Firefox, Google and other browsers

Achieve vertical centering in Firefox, Google and other browsers


Untitled Document

  < /strong>





Personal summary: display:table-cell; should be defined in a cell with specific width and height value inside the block element container, otherwise vertical centering under browsers such as Firefox cannot be achieved






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