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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Irfan Hussain](https://uploads.teamtreehouse.com/production/profile-photos/6151932/micro_photo.jpg)
Irfan Hussain
Courses Plus Student 6,593 PointsWhy my banner logo overlap with header...
<!DOCTYPE HTML> <html lang="en-US"> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Best City Guide</title> <link href='https://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="normalize.css" /> <link rel="stylesheet" href="style.css" /> </head> <body> <header class="main-header"> <div class="container clearfix"> <h1 class="name"><a href="#"> Best City Guide </a> </h1>
<ul class="main-nav">
<li><a href="#">ICE CREAM</a></li>
<li><a href="#">DONUT</a></li>
<li><a href="#">TEA</a></li>
<li><a href="#">COFFEE</a></li>
</ul>
</div>
</header>
<!-- Start Banner -->
<div class="banner">
<img class="logo" src="img/city-logo.svg" alt="The Best City" >
<h1 class="headling"> The Best City </h1>
<span class="tagline">The best drinks and eats in the best city ever.</span>
</div> <!-- End banner -->
<div class="container clearfix">
<div class="secondary col">
<h2>Welcome!</h2>
<p>Everything in this city is worth waiting in line for.</p>
<p>Cupcake ipsum dolor sit. Amet chocolate cake gummies jelly beans candy bonbon brownie candy. Gingerbread powder muffin. Icing cotton candy. Croissant icing pie ice cream brownie I love cheesecake cookie. Pastry chocolate pastry jelly croissant.</p>
<p>Cake sesame snaps sweet tart candy canes tiramisu I love oat cake chocolate bar. Jelly beans pastry brownie sugar plum pastry bear claw tiramisu tootsie roll. Tootsie roll wafer I love chocolate donuts.</p>
</div><!--/.secondary-->
</div>
</body> </html>
- { box-sizing: border-box; }
body { font-family: 'Varela Round', sans-serif; color: 3a3a3a; line-height: 1.6; }
a { text-decoration: none; }
h2, h3, a { color: #093a58; }
img { max-width: 100%; }
/***************************************** Main Header *****************************************/
.main-header { padding-top: .5em; padding-bottom: .5em; }
.name { font-size: 1.25em; margin: 0; }
.name a, .main-nav a{ display: block; text-align: center; padding: 10px 15px;
}
.main-nav a {
font-size: .95em;
color: #3acec2;
text-transform: uppercase;
}
/***************************************** Banner *****************************************/ .banner { text-align: center; }
.banner { color: #fff; background: #3acec2; padding: 3.2em 0; margin-bottom: 60px;
} .logo { width: 190px; } .headline { margin-bottom: 0; } /***************************************** Responsive Layout *****************************************/
@media (min-width: 750px) {
.main-header {
position: fixed;
background: #fff;
box-shadow: 0 1px 4px rgba(0,0,0,.4);
width: 100%;
top: 0;
z-index: 1000;
}
.container {
width: 90%;
margin: 0 auto;
}
.name {
float: left;
}
.main-nav {
float: right;
}
.main-nav li{
display: inline-block;
margin-left: 15px;
}
.clearfix::after {
content: " ";
display: table;
clear: both;
}
}
1 Answer
![Laura Reivinen](https://secure.gravatar.com/avatar/48f227715b425d553f00e11b846fccca?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Laura Reivinen
12,520 PointsHi there! I think your problem might be that since your header has position:fixed, the banner is positioned at the top of the page. The problem is solved if you add margin-top that equals the height of your header to banner class.
Steven Parker
230,688 PointsSteven Parker
230,688 PointsWhen posting code, use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area.
Or watch this video on code formatting.