简体   繁体   中英

Twitter Bootstrap centering responsive navbar gap on background hover

I have tried this solution in order to center my bootstrap nav , however is its causing a small gap at the bottom of my on hover effects? I think this is due to the float but i dont know how to fix it.

navbar-collapse.collapse {
text-align: center; /* Set this */
height: auto !important;
padding-bottom: 0;
overflow: visible !important;
font-weight:bold;
}

/* This should be around line 4866 in your bootstrap.css */
.navbar-nav {
display:inline-block;
float: none;
margin: 0;
}`

EDIT ----

Link to code http://www.bootply.com/sp1jl3CnJ0

You can try this

CSS

.navbar-nav {
    display: table;
     float: none;
   margin: 0 auto;
}

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM