Necesito poner una imagen de fondo (logo) dentro de una barra de navegación Bootstrap, como hago? este es mi código html:
<!-- Navigation --> <nav id="mainNav" class="navbar navbar-default navbar-fixed-top"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand page-scroll" href="#page-top"></a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <li> <a class="page-scroll" href="index.html">Home</a> </li> <li> <a class="page-scroll" href="about.html">About</a> </li> <li> <a class="page-scroll" href="#gallery">Gallery</a> </li> <li> <a class="page-scroll" href="#contacts">Contacts</a> </li> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container-fluid --> </nav>
Y este mi CSS:
.navbar-default { border-color: rgba(34,34,34,.05); font-family: 'Open Sans','Helvetica Neue',Arial,sans-serif; background-color: #fff; -webkit-transition: all .35s; -moz-transition: all .35s; transition: all .35s; } .navbar-default .navbar-header .logo{ width: 100%; max-width: 1920px; } .navbar-default .navbar-header .navbar-brand { text-transform: uppercase; font-family: 'Open Sans','Helvetica Neue',Arial,sans-serif; font-weight: 700; color: #f05f40; } .navbar-default .navbar-header .navbar-brand:hover, .navbar-default .navbar-header .navbar-brand:focus { color: #eb3812; } .navbar-default .nav > li>a, .navbar-default .nav>li>a:focus { text-transform: uppercase; font-size: 13px; font-weight: 700; color: #222; } .navbar-default .nav > li>a:hover, .navbar-default .nav>li>a:focus:hover { color: #f05f40; } .navbar-default .nav > li.active>a, .navbar-default .nav>li.active>a:focus { color: #f05f40!important; background-color: transparent; } .navbar-default .nav > li.active>a:hover, .navbar-default .nav>li.active>a:focus:hover { background-color: transparent; }
Respuestas
Hay una clase .navbar-brand
. Ahí puedes poner el logo.
@Yeiij
28 marzo 2016, 18:54