-1

Basically i have 2 images (vertical align) inside a wrapper. Now, i just need to center the wrapper inside the body.

How can i center my wrapper inside the body?

<!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>
Marco
  • 2,687
  • 7
  • 45
  • 61
  • See: [How to center an element horizontally and vertically?](http://stackoverflow.com/questions/19461521/how-to-center-an-element-horizontally-and-vertically/19461564#19461564). – Josh Crozier Feb 06 '15 at 02:37

1 Answers1

0

Try adding:

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

to the wrapper.

Nisse Engström
  • 4,738
  • 23
  • 27
  • 42
Nishanth Matha
  • 5,993
  • 2
  • 19
  • 28