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
Ryan Hellerud
3,635 Pointsweird position nav bar
Hi guys so a site I've been working on is acting up and has randomly re-positioined itself wierdly on the top bar and I have no idea why. I thought everything was fine before, however recently I saw the site and it just so happened that theres a wierd space at the top of the page between the nav bar and the window url. Can someone inspect it and help me figure out whats causing this and if there would be a quick or easy fix. The site is www.omegadesignla.com and any help would be appreciated, thanks.
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Omega Design | LA</title>
<meta name="description" content="Web development and printing services serving the greater los angeles area">
<meta name="keywords" content="web development, printing, graphics design, los angeles, santa clarita">
<link rel="stylesheet" href="stylesheets/app.css" />
<link rel="stylesheet" href="stylesheets/foundation-icons.css" />
<link rel="stylesheet" href="css/normalize.css" />
</head>
<body>
<nav class="top-bar" data-topbar>
<ul class="title-area">
<li class="name">
<span><a href="index.html"><img class="logo" src="img/logofinal.png"></a><span>
</li>
<li class="toggle-topbar menu-icon">
<a href="#">Menu</a>
</li>
</ul>
<section class="top-bar-section">
<ul class="right">
<li><a href="#about">About us</a></li>
<li><a href="#" data-reveal-id="myModal">Contact us</a></li>
<li class="has-dropdown">
<a href="#">Services</a>
<ul class="dropdown">
<li><a href="services.html#printing">Print Media</a></li>
<li><a href="services.html">Web Development</a></li>
<!-- <li><a href="services.html">Promotional Items</a></li> -->
<!-- <li class="active"><a href="#">Active link in dropdown</a></li> -->
</ul>
</li>
</ul>
</section>
</nav>
<div class="container">
<header>
*,
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* line 392, ../bower_components/foundation/scss/foundation/components/_global.scss */
html,
body {
font-size: 100%;
}
/* line 396, ../bower_components/foundation/scss/foundation/components/_global.scss */
body {
background: #fff;
color: #222;
padding: 0;
margin: 0;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-weight: normal;
font-style: normal;
line-height: 1.5;
position: relative;
cursor: auto;
}
/* line 409, ../bower_components/foundation/scss/foundation/components/_global.scss */
a:hover {
cursor: pointer;
}
/* line 412, ../bower_components/foundation/scss/foundation/components/_global.scss */
img {
max-width: 100%;
height: auto;
}
1 Answer

Jamie Allison
3,358 PointsCould you post your CSS too? The code looks fine and the issue is almost certainly in the CSS. I inspected the element with Firebug through Firefox, and it seems that there is a ::before and ::after pseudoclass that may be causing an issue with the nav bar, or it could be a padding issue. I'd suggest inspecting the page yourself with whatever software you're comfortable with, and focusing on that particular section. Try commenting out some of the pseudoclasses or padding/margin and see what happens. The issue is more than likely with the top-bar-section class so focus on that to start. I can help you more after looking over your CSS.
Ryan Hellerud
3,635 PointsRyan Hellerud
3,635 PointsI forgot to mention that it was pointed out to me that there was a random line being generated if you inspect the body at the top it shows these &NBSP&NBSP being created which seems to add a line. If I can get rid of those I should be able to get rid of the problem. Also the css file is huge because i used zurb foundation 5 and scss so it generated a ton of css. I can post what might be relevant though, thanks.
ps. to look at more css can you please look at the sources tab under stylesheets