So I've been designing some simple header bars for my website, and I've just noticed that I have an unexpected space in between nested divs in the bar.
Here's how it's been going.
HTML
<body>
<div class='main-container'>
<div class='button'>
<p> Issues </p>
</div>
<div class='button'>
<p> Calendar </p>
</div>
<div class='button'>
<p> Staff </p>
</div>
<div class='button'>
<p> Submit </p>
</div>
</div>
</body>
... with this CSS
.main-container {
width: auto;
height: 40px;
float: left;
vertical-align: middle;
font-family: 'Arial';
font-size: 12px;
background-color: #fff;
border: 1px solid #d3d3d3;
}
.button {
text-align: center;
display: inline-block;
height: 100%;
width: 100px;
// borders are to illustrate spaces
border-left: 1px solid black;
border-right: 1px solid black;
}
.button:hover {
background-color: #D3D3D3;
}
and it looks like this (since I don't have enough reputation, I'll have to do a simple graphical representation):
| Issues | | Calendar | | Staff | | Submit |
Is there a way to remove the spaces in between the divs?