Just use CSS to center the top, bottom, left, and right of the image in the container

大家讲道理
Release: 2016-11-11 09:30:15
Original
1354 people have browsed it

.main{ width:600px; height:400px; margin:100px auto;text-align:center;vertical-align:middle;display:block;position:relative; background:#ddd;}
.main a{display:table-cell;vertical-align:middle;width:600px; height:400px; }
.main a img{max-width:600px;max-height:400px; }
Copy after login

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