2015-02-06 55 views
-1

基本上我有2个图像(垂直对齐)内包装。现在,我只需要将包装物放在身体中间。身体内部的垂直和水平中心

我怎么能我的包装在体内?

<!DOCTYPE html> 
<html lang="es-ES"> 
<head> 
    <meta charset="utf-8"> 
    <base href="<?php echo BASE; ?>"> 
    <title>tittle goes here</title> 
    <meta name="description" content="descr goes here"> 
    <style type="text/css"> 
     body {margin: 0; padding: 0;} 
     .wrapper {background-color: red; display: inline-block;} 
     .wrapper span {display: inline-block; vertical-align: middle; margin: 0 20px;} 
     .wrapper span img {display: block;} 
    </style> 
<body> 
<div class="wrapper"> 
    <span><a href=""><img src="..." width="225" height="60" alt="..."></a></span> 
    <span><a href=""><img src="..." width="120" height="120" alt="..."></a></span> 
</div> 
</body> 
</html> 
+0

请参见:[如何将元素水平和垂直居中?](http://stackoverflow.com/questions/19461521/how-to-center-an-element-horizo​​ntally-and-vertically/19461564#19461564)。 – 2015-02-06 02:37:10

回答

0

尝试增加:

text-align: center; display: table-cell; vertical-align: middle; 

的包装。