I'm trying to center an image in the fixed nav
menu of a flex item.
I've tried using the justify-content: center;
command, but I don't think it did anything.
Below is the CSS and abbreviated HTML. Codepen: http://codepen.io/anon/pen/XmQQgb
CSS:
body {
padding:0;
margin:0
}
.wrapper {
display: flex;
}
nav {
flex: 0 0 300px;
background: gray;
}
.nav-wrapper {
position: fixed;
top: 0; left: 0;
}
section {
flex: 1 1;
padding: 20px;
}
.navImage {
display: block;
margin: 0 auto;
}
HTML
<div class="wrapper">
<nav role="navigation">
<div class="nav-wrapper">
<img class="navImage" width="100" height="100" src="https://upload.wikimedia.org/wikipedia/commons/5/56/Run.svg">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Clients</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
<blockquote><i>Please, make me fixed!</i></blockquote>
</div>
</nav>
<section>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero.</p>
</section>
</div>