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

WBOY
Release: 2016-06-24 12:27:15
Original
899 people have browsed it

" -//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






source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template