I have observed that every time I attempt to create a navigation bar, there is an unwanted left and top margin of approximately 8px. This margin seems to persist regardless of the code in my CSS file. I am starting to wonder if this is some sort of default setting and if I am approaching the task incorrectly. How can I solve this issue? I tried adding a -8px margin to the left and top of the toolbar which aligned it perfectly with the browser window; however, this approach leaves empty space when users scroll horizontally.
CSS
body {
}
.navbar-container {
width: 100%;
background-color: #252122;
/*margin-left:-8px;
margin-top:-8px;*/
}
.navbar-container table {
width: auto;
}
.classifieds-container {
overflow: hidden;
z-index: -1;
top: 40px;
left: 0;
right: 0;
display: block;
width: 960px;
padding-bottom: 25px;
background: #fff;
box-shadow: 1px 0 7px;
font: 11px "Arial",sans-serif;
color: #000;
/*line-height: 59px;*/
}
.classifieds-container label {
color: blue;
}
.classifieds-container label:hover {
color: red;
text-decoration: underline;
}
.classifieds-container table {
width: 960px;
}
.classifieds-container .col {
float: left;
margin-left: 15px;
}
.col-one {
margin-top: 60px;
float: left;
margin-left: 200px;
max-width: 175px;
text-wrap: normal;
}
.col-one h3 {
text-align: center;
}
.row-splitter {
border-bottom: solid;
border-width: 1px;
border-color: gray;
margin-top: 5px;
margin-bottom: 5px;
}
.classified-link-descriptor {
color: gray;
text-decoration: none;
font: 11px "Arial",sans-serif;
margin-bottom: 5px;
display: block;
}
nav {
display: block;
}
.logo-header {
height: 35px;
width: auto;
float: right;
}
HTML
<body>
<nav>
<div id="Navigation">
<div class="navbar-container">
<table>
<tbody>
<tr>
<td colspan="2">
<img class="logo-header" src="~/Content/logo_black_background.png" />
</td>
<td colspan="6">
<div>
@(Html.Kendo().Menu()
.Name("Menu")
.Items(items =>
{
items.Add()
.Text("Home");
items.Add()
.Text("Classifieds")
.Content(@<text>
...
</div>