Center Divs with CSS
Using two divs to center elements.
by moojjoo
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<div class="row">
<div class="container">
<div id="outerLogo">
<div id="innerLogo">
<a href="/" title="Logo Goes Here!!!"><img style="border: 5px dotted #4cff00;" class="img-responsive" alt="Be sure to include alt text for SEO Optimization." src="Logo.png" style="border:none" /></a>
</div>
</div>
</div>
</div>
CSS
#innerLogo {
display: table-cell;
margin: 0 auto;
border: 1px dashed blue;
vertical-align: middle;
}
#outerLogo {
display: table;
width: 100%;
text-align: center;
height: 400px;
border: 1px dashed red;
}