Why will this not drop my anchor from the top?

Glenn

Member
.nav-bar a {
margin: 4px 0px 0px 4px;
color: #004890;
font-size: 13px;
text-decoration: none;
font-weight: bold;
}
 

Glenn

Member
Here's all I have right now until I get it to work. I have tried using margin-top but it does not work either.

<div class="nav-bar">
<a href="/">Home</a>

</div>

Here's all that my nav-bar has right now.

.nav-bar {
background-image: url('images/Nav-bg.jpg');
height: 31px;
width: 100%;
}
 

benjamin.morgan

New Member
Are you trying to center it or what? If you are trying to center it you can use line-height to make it centered.

http://codepen.io/benjaminmorgan/pen/gqiHo

Otherwise, since it is a div, you would need to display it inline-block since you only have a height of 31 on the div. Just click on the link and look over the code, if you have any questions just ask.
 

Glenn

Member
Are you trying to center it or what? If you are trying to center it you can use line-height to make it centered.

http://codepen.io/benjaminmorgan/pen/gqiHo

Otherwise, since it is a div, you would need to display it inline-block since you only have a height of 31 on the div. Just click on the link and look over the code, if you have any questions just ask.

I'm not trying to center it, unless you mean center it vertically. I'm just trying to keep it from being up next to the top of the nav bar I have created.
 

benjamin.morgan

New Member
That is what I meant Glenn, If you viewed the code, adding inline-block made the margin-top work. If you want it perfectly centered vertically, use line-height: 31px;
 
Top