Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Armando Abrahamsson
1,391 PointsNavbar logo issue.
Hey guys! I am trying to add a simple <h1> logo to my navbar. I am simply looking for advice on whether to add a div on top of the navbar(which is fixed btw) or add the logo to the list and then try to move it left, which I have not yet been able to do.
Thanks in advance!
Here's My Code.
header {
height: 100px;
position: fixed;
width: 100%;
background: #ffffff;
background: -moz-linear-gradient(top, #ffffff 0%, #d6d6d6 100%);
background: -webkit-linear-gradient(top, #ffffff 0%,#d6d6d6 100%);
box-shadow: 0 5px 10px rgba(0,0,0,0.3);
z-index: 10;
}
#header-content {
width: 1000px; margin: 0 auto; padding: 35px 0 0 0;
overflow: hidden;
}
#header-content h1 {
float: left;
font-size: 50px; text-transform: uppercase; letter-spacing: 10px;
}
#header-content nav {
float: right;
}
#header-content nav li {
float: left;
font-size: 20px;
margin: 0 0 0 50px;
list-style: none;
}
```css
```html
<header>
<div id="header-content">
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="portfolio.html">Portfolio</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
</div>
</header>
```html
2 Answers
Razvan Balosin
2,383 PointsI'd say you should leave your nav element alone and add your logo in a div just before
<nav>
This would help you keep your structure more organised, especially your css.
Armando Abrahamsson
1,391 PointsAh man so basic. Thanks!