Rumah >hujung hadapan web >tutorial css >只用CSS就可实现容器内图片上下左右居中
.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; }