I am trying to add a logo as the brand on a fixed-bottom navbar. The logo is larger than the navbar itself. I want it to overlap the body, but instead it hangs below the top of the links.
I don't know what element to style in to change.
.navbar {
height:72px;
background: transparent;
background-image: url("../images/nav-bkgd.png");
background-repeat: repeat-x;
border: 0;
text-transform: uppercase;
font-family: "Bangers","Helvetica Neue",Helvetica,Arial,sans-serif;
letter-spacing: 2px;
padding-left: 35px;
padding-right: 35px;
}
.navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
}
.navbar-fixed-bottom {
font-size: 2em;
-webkit-transition: all .3s;
-moz-transition: all .3s;
transition: all .3s;
}
<body>
<div class="container">
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><img src='assets/images/logo.png'</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li>
<a class="page-scroll" href="#">TROPOSHPERE</a>
</li>
<li>
<a class="page-scroll" href="#">STRATOSPHERE</a>
</li>
<li>
<a class="page-scroll" href="#">MESOSPHERE</a>
</li>
<li>
<a class="page-scroll" href="#">THERMOSPHERE</a>
</li>
<li>
<a class="page-scroll" href="#">EXOSPHERE</a>
</li>
</ul>
</div>
</div>
</nav>
try
.navbar-brand img {
margin-top: -16px;
}
I just put -16px as a random measurement but tweak it to match what you want of course.
Also the img tag within the link isn't closed (missing /> )
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.