Check out this jsfiddle for my current project's nav setup. I want to center the logo in the middle of the nav with three links centered around it. However, I need the design to be responsive across various screen widths. Any advice on how to achieve that?
I also need to use a .png as a border on divs without specifying a fixed height. But when I set it to height:auto, the background-color disappears. How can I solve this issue?
Here's the HTML code:
<div id="header-wrap" class="group">
<nav>
<a href="index.html"><img class="logo" src="http://i60.tinypic.com/1zxqqm1.png" alt="Cat Town Cafe & Adoption" /></a>
<ul>
<li><a href="index.html">ABOUT</a>
</li>
<li><a href="index.html">OUR CATS</a>
</li>
<li><a href="index.html">RESERVATIONS</a>
</li>
<li><a href="index.html">DONATE</a>
</li>
<li><a href="index.html">HELP OUT</a>
</li>
<li><a href="index.html">CONTACT</a>
</li>
</ul>
</nav>
</div>
The CSS code:
#header-wrap {
width: 100%;
height: auto;
position: relative;
background-color: #E6D7B8;
z-index: 5;
}
#header-wrap:after {
width: 100%;
height: 4px;
background: url("http://i57.tinypic.com/30uxn47.png") repeat-x;
-webkit-transform: rotate(-180deg);
-moz-transform: rotate(-180deg);
-ms-transform: rotate(-180deg);
-o-transform: rotate(-180deg);
transform: rotate(-180deg);
position: absolute;
bottom: -4px;
left: 0;
display: block;
content:"";
z-index: 5;
}
nav {
background: #E6D7B8;
height: 60px;
position: relative;
}
nav ul {
margin: 0 auto;
padding: 0;
list-style: none;
}
nav li a {
display: block;
float: left;
padding: 0 18px;
height: 60px;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
position: relative;
font: 400 14px'Bitter';
letter-spacing: 0.05em;
color: #893B4E;
text-transform: uppercase;
text-decoration: none;
}
nav li a:hover {
box-shadow: inset 0px 4px 0px #4C264B;
}
nav li a:hover:before {
width: 100%;
height: 100px;
background: linear-gradient(#4C264B, transparent);
display: block;
content:"";
position: absolute;
left: 0;
z-index: -1;
}
nav ul li {
float: left;
}
nav ul li:nth-of-type(4) {
margin-left: 277px;
}
.logo {
position: absolute;
left: 50%;
margin: 0 0 0 -135px;
max-width: 270px;
z-index: 100;
}