bootstrap 3 navbar with custom height issues - html

I have created a custom height navbar with a large logo image and I'm sure I have missed something in the CSS because when the dropdown menu is clicked it jumps higher on the page until it is clicked a second time, and then the link works.
There is a "working" example at http://machadodesign.com/bootstrap/
Here is the CSS I have for the navbar
#media (min-width: 992px) {
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
min-height: 85px;
bottom: 0 ;
}
}
.navbar-nav li a {
padding-top: 30px;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
color: #333;
background-color: #e7e7e7;
}
.navbar-default .navbar-nav .active a {
background: #f8f8f8;
text-shadow: 0px 0px 9px rgba(144, 169, 210, 1) !important;
}
.dropdown .active {
text-shadow: 0px 0px 9px rgba(144, 169, 210, 1) !important;
}
.navbar-brand {
height: inherit;
padding: 5px 15px;
}
.navbar-brand a{
padding-top: 0 !important;
}
.navbar-brand img {
height: 50px
}
.dropdown li, .dropdown li:hover {
/* padding-top: 10px;*/
padding-bottom: 0px !important;
/* min-height: 40px;*/
}
.dropdown li a {
padding-top: 10px;
padding-bottom: 0px !important;
min-height: 40px;
}
.logo-tag {
font-size: 10px;
font-style: italic;
font-weight: 700;
line-height: 14px;
letter-spacing: 0.04em;
}
#media (min-width: 768px) {
.logo-tag {
font-size: 13px;
font-style: italic;
font-weight: 700;
line-height: 14px;
letter-spacing: 0.04em;
}
.navbar-brand img {
height: 58px
}
.navbar-brand {
height: inherit;
padding: 3px 15px;
}
}
Here is the HTML of the navbar as I have it.
<nav role="navigation" class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid social-bar hidden-xs">
<div class="container">
<div class="row">
<div class="col-sm-9">Questions? Need help? Call now: (866) 214-6128</div>
<div class="col-sm-3 text-right">
<ul class="list-inline">
<li><i class="fa fa-lg fa-facebook"></i></li>
<li><i class="fa fa-lg fa-twitter"></i></li>
<li><i class="fa fa-lg fa-google-plus"></i></li>
<li><i class="fa fa-lg fa-youtube"></i></li>
<li><i class="fa fa-lg fa-rss"></i></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" id="myNavbar" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img src="images/logo.png"><span class="logo-tag">Customer and Class Management Made Easy!</span>
</div>
<!-- Collection of nav links and other content for toggling -->
<div id="navbarCollapse" class="collapse navbar-collapse navbar-right">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li class="dropdown">
Features <span class="caret"></span>
<ul class="dropdown-menu navbar-right">
<li>Features Overview</li>
<li>Easy Startup!</li>
<li>Easy to Use!</li>
<li>Easy to Customize!</li>
<li>Power-user Features</li>
<li>Multi-country</li>
<li>Lots of Add-ons</li>
</ul>
</li>
<li class="dropdown">
Try it Free <span class="caret"></span>
<ul class="dropdown-menu">
<li>Take a Test Drive</li>
<li>Get Started Today</li>
</ul>
</li>
<li>Pricing</li>
<li>Contact Us</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><i class="fa fa-lock"></i> Login</li>
</ul>
</div>
</div>
</nav>
Any help is greatly appreciated.

The problem is right at the top of your provided CSS:
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
min-height: 85px;
bottom: 0 ;
}
It only retains its min-height if it is hovered over or in focus, which is why the click is causing the jump (triggering focus). Change it to this:
.navbar-default .navbar-nav > li > a {
min-height: 85px;
bottom: 0 ;
}

Related

Active navbar not highlight

I'm a new to this website and for coding, i m trying to highlight active menu. i have been search almost of two weeks. still not resolved. i have tried with jquery cdn, it works, but when i upload all this to web, it doesn't work. when i click the menu it highlight and disappear suddenly. so it didnt succes with jquery cdn. here is the jquery cdn i have used.
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script type="text/javascript">
$(document).on('click', 'ul li', function(){
$(this).addClass('active').siblings().removeClass('active')
})
</script>
please help. here are my codes. if css wrong can someone of you please correct this?
<div id="main-wrap">
<nav class="navbar navbar-default ">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="/">
<div class="sidebar-pinner">
<button type="button" class="btn btn-secondary collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
</div>
<div id="scrollNav">
<ul class="nav navbar-nav navbar-left-block">
<li><span class="ico"><i class="fas fa-home"></i></span> Home</li>
<li class="currentPage"><a>Home</a></li>
</ul>
<ul class="nav navbar-nav navbar-right navbar-right-block">
<li class="user-balance"><span class="ico"><i class="material-icons">attach_money</i></span> <span class="nav-text">$0.00</span><span class="hidden badge" style="background-color: #fea621;">$0.00</span></li>
<li class="dropdown">
<span class="ico"><i class="fas fa-user-cog"></i></span> <span class="nav-text">newuserpanel</span> <span class="caret"></span>
<ul class="dropdown-menu">
<li>Account</li>
<li>API</li>
<li>Logout</li>
</ul>
</li>
</ul>
</div>
<div class="collapse navbar-collapse mobileNav" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li ><span class="ico"><img src="/home.png" alt="Home" /></span> Home</li>
<li ><span class="ico"><img src="/Services.png" alt="Services" /></span> Services</li>
<li ><span class="ico"><img src="/history.png" alt="History" /></span> history</li>
<li ><span class="ico"><img src="/Support.png" alt="Support" /></span> Support</li>
<li ><span class="ico"><img src="/FAQ.png" alt="FAQ" /></span> FAQ</li>
<li ><span class="ico"><img src="/API.png" alt="API" /></span> API</li>
<li ><span class="ico"><img src="/Terms.png" alt="Terms" /></span> Terms</li>
</ul>
</div>
</div>
</nav>
<div class="nav-bottom">
<div class="container">
<ul class="nav page-navigation">
<li ><span class="ico"><img src="home.png" alt="Home" /></span> Home</li>
<li ><span class="ico"><img src="Services.png" alt="Services" /></span> Services</li>
<li ><span class="ico"><img src="history.png" alt="Orders" /></span> History</li>
<li ><span class="ico"><img src="/API.png" alt="API" /></span> API</li>
<li class="dropdown ">
<span class="ico"><img src="/dggher5t.png" alt="chaman" /></span> Support <span class="caret"></span>
<ul class="dropdown-menu">
<li ><span class="ico"><img src="/Support.png"/></span> Support</li>
<li ><span class="ico"><img src="/FAQ.png" alt="FAQ" /></span> FAQ</li>
<li ><span class="ico"><img src="/Terms.png" alt="Terms" /></span> Terms</li>
</ul>
</li>
</ul>
</div>
</div>
here is the css
}
.dahshat-board .navbar-default {
background-color: transparent;
border-color: transparent;
padding: 10px 0;
margin: 0;
background-image: none;
}
.nav-bottom {
position: relative;
z-index: 3;
}
.nav.page-navigation {
background: #fad534;
border-radius: 500px;
display: flex;
width: 100%;
position: relative;
box-shadow: 0 2px 10px 0 rgba(0,0,0,.08);
justify-content: center;
}
.nav.page-navigation li {
display: inline-flex;
width: auto;
align-items: center;
flex: 0 0 10.85%;
flex-grow: 1;
}
.nav-bottom .nav .dropdown li {
display: block;
width: auto;
text-align: left;
}
.nav-bottom .nav li .ico {
margin-right: 4px;
width: 28px;
height: 28px;
background: #2b1f60;
border-color: #2b1f60;
}
.nav-bottom .nav li.active .ico {
background: #fad534;
border-color: #fad534;
}
.nav-bottom .nav li.active .ico img {
filter: invert(1) brightness(100%) saturate(0);
}
.nav-bottom .nav li a {
font-size: 13px;
line-height: 44px;
color: #2a1e5e;
display: flex;
justify-content: center;
position: relative;
align-items: center;
padding: 2px 9px;
border-radius: 500px;
white-space: pre;
width:100%;
}
.nav-bottom .nav li.dropdown.open a.dropdown-toggle {
/* background: transparent;
border: none; */
}
.nav-bottom .nav li a:hover,
.nav-bottom .nav li a:active,
.nav-bottom .nav li a:focus {
background: transparent;
outline: none;
}
.nav-bottom .nav .dropdown li a {
line-height: 18px;
display: block;
padding: 4px 10px;
position: relative;
}
.nav-bottom .nav .dropdown li a .badge {
position: absolute;
right: 8px;
top: 13px;
padding: 3px 7px;
font-size: 10px;
}
.nav-bottom .nav li.active a {
color: #fad534;
background-color: #270044;
}
.nav-bottom .nav .dropdown li a::after,
.nav-bottom .nav .dropdown li a::before {
display: none;
}
.navbar-collapse.mobileNav{
padding:0;
}
.navbar-collapse.collapse.mobileNav ul.navbar-nav.nav {
display: none;
}
.nav-bottom .nav li.dropdown.open .dropdown-menu a {
background: transparent;
border-radius: 0;
color: #2a1e5e;
}
.dahshat-board .navbar-default .navbar-nav > li > a {
color: #ffffff;
font-size: 14px;
padding-top: 0;
padding-bottom: 0;
display: flex;
align-items: center;
padding-top: 10px;
padding-bottom: 10px;
line-height: 34px;
}
.dahshat-board .navbar-default #scrollNav.fixedNav .navbar-nav > li > a {
color: #4d0e88;
}
.dahshat-board .navbar-default #scrollNav.fixedNav .navbar-nav > li > a .ico {
background: #480d80;
color: #efe9f5;
border: 1px solid #480d80;
}
.dahshat-board .navbar-default .navbar-nav > li > a:hover,
.dahshat-board .navbar-default .navbar-nav > li > a:focus{
color: #ffffff;
background-color:transparent;
}
.dahshat-board .navbar-default .navbar-nav > .open > a,
.dahshat-board .navbar-default .navbar-nav > .open > a:hover,
.dahshat-board .navbar-default .navbar-nav > .open > a:focus{
background: transparent;
}
.dahshat-board .navbar-default .navbar-nav.navbar-left-block .currentPage {
position: relative;
}
.dahshat-board .navbar-default .navbar-nav.navbar-left-block .currentPage::before {
content: '/';
color: #ffffff;
display: inline-block;
position: absolute;
top: 17px;
left: 0;
}
.dahshat-board .navbar-default #scrollNav.fixedNav .navbar-nav.navbar-left-block .currentPage::before{
color: #480d80;
}
.navbar-nav li.mobileSearch{
display: none;
}
The previous CSS it's a little too long, so i'll get into the explanation.
When you use this
$(document).on('click', 'ul li', ...
You're selectin any li element which is son, or grandson or so on, from any ul element. This kind of selector should be used wisely, or you may end selecting something you don't want to.
So first, try changing that into
$(document).on('click', 'ul>li', ...
To select only li elements who are direct child of ul elements.
Then, make sure that your CSS rules target to li elements with an "active" class to apply your rule and that should make it.
Edit: If this is the only thing where you're using Jquery, you may try this instead and get rid of Jquery in order to save some bandwidth when loading the page:
let prev = null;
let items = document.querySelectorAll("ul>li");
items.forEach((el)=> el.addEventListener("click", ()=>{
el.classList.add("active");
if(prev) prev.classList.remove("active");
prev = el;
});
I hope this helps enough.

How can i make the list appear on hover?

So I have this code:
.hoverlist12:hover #details {
display: block;
}
The thing is the list doesn't appear at all. If I change the hoverlist12 class with the ul, it works fine, but it appears when I hover on all the elements, and I want it to appear when I hover it only on the first "li". Usually, I have no problem doing this but now I just can't figure it out.
.navbar {
border-radius: 0;
max-height: 50px;
}
.navbar-default .navbar-nav > li > a,
.navbar-default .navbar-brand {
color: #ffffff;
}
.navbar-default .navbar-brand:hover {
color: #ffffff;
transform: scale(1.1);
}
.navbar-default .navbar-nav > li > a:focus,
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-brand:focus,
.navbar-default .navbar-brand:hover {
color: #ffffff;
}
.navbar-default .navbar-nav > li:focus,
.navbar-default .navbar-nav > li:hover {
background-color: rgba(0, 0, 0, 0.15);
}
nav {
font-family: "ITCErasStd-Medium";
}
.hiddeOnTop {
visibility: hidden;
}
.container-fluid {
padding-right: 3%;
padding-left: 3%;
display: inline-block;
width: 100%;
}
.navbar-default,
.container-fluid {
background-color: #be3c7a;
}
.nav > li > a {
font-size: 1.1em;
}
.navbar .facebook {
padding: 0;
margin-top: 7px;
}
.navbar .facebook:hover {
background: none;
transform: scale(1.1);
}
.navbar-brand,
.nav > li.active > a {
font-family: "ITCErasStd-Bold";
}
#details {
padding: 26px 30px;
display: none;
color: white;
z-index: 900;
font-size: 2rem;
list-style-type: none;
position: absolute;
margin-top: 50px;
background-color: #be3c7a;
}
.hoverlist12:hover #details {
display: block;
}
<nav class="mobile_nav">
<button type="button">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<ul class="nav-content">
<li>
<a href="htps://www.facebook.com" alt="facebook" class="facebook"
><img
src="./img/fb-icon.svg"
alt="fb-icon"
onerror="this.src='./img/fb-icon.png'"
/></a>
</li>
<!-- <li class="homelk">HOME</li> -->
<li class="homelk">
CE ESTE adadsadassssss
</li>
<li>INTREBARI FRECVENTE</li>
<li>PARTENERI</li>
<li>CONTACT</li>
<!-- <li><i class="fa fa-facebook-official"></i></li> -->
</ul>
</nav>
<!-- //////////////////////////// NAVBAR \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\-->
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button
type="button"
class="navbar-toggle"
data-toggle="collapse"
data-target="#myNavbar"
>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand navigate" href="#home"><span>HOssME</span></a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right dropdown">
<li class="hoverlist12">
CE ESTE USCACIUNEA
</li>
<ul id="details">
<li>Manifestari</li>
<li>Femeia activa</li>
<li>Maternitatea</li>
<li>Menopauza</li>
<li>Sub tratament</li>
</ul>
<li> DE CE HAYLO GYN </li>
<li> INTREBARI </li>
<li>CONTACT</li>
<li>
<a href="htps://www.facebook.com" alt="facebook" class="facebook"
><img
src="./img/fb-icon.svg"
alt="fb-icon"
s
onerror="this.src='./img/fb-icon.png'"
/></a>
</li>
<!-- <li><i class="fa fa-facebook-official"></i></li> -->
</ul>
</div>
</div>
</nav>
Use selector like this: .hoverlist12:hover ~ #details Because #details and .hoverlist12 elements are siblings or at same level. You can use this selector only .hoverlist12:hover #details when #details is a child element of .hoverlist12. So, please change your CSS code as I suggested OR Please change your structure like:
<li class="hoverlist12">
CE ESTE USCACIUNEA
<ul id="details">
<li>Manifestari</li>
<li>Femeia activa</li>
<li>Maternitatea</li>
<li>Menopauza</li>
<li>Sub tratament</li>
</ul>
</li>

How to add dropdown below the navbar in bootstrap 3.3.7

So I am trying to make my dropdown actually appear below the navbar like in the shown picture
Here is my html:`
<div class="container">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed"
data-toggle="collapse" data-target="#myNavbar">
<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 logo" href="#"></a>
</div>
<div class="collapse navbar-collapse navbar-right" id="myNavbar">
<ul class="nav navbar-nav">
<li class="dropdown"><a href="#" class="dropdown-toggle"
data-toggle="dropdown" role="button" aria-expanded="false">blah
<!-- <span class="caret"></span> -->
</a>
<ul class="dropdown-menu" role="menu">
<li>blah1</li>
<li>blah 2</li>
<li>blah 3</li>
</ul></li>
<li>blah</li>
<li class="dropdown"><a href="#" class="dropdown-toggle"
data-toggle="dropdown" role="button" aria-expanded="false">blah
</a>
<ul class="dropdown-menu" role="menu">
<li>blah</li>
<li>blah & blah</li>
<li>blah</li>
</ul></li>
<li> blah</li>
<li>blah</li>
<li><img src="../images/search.png"/></li>
<li>Login</li>
</ul>
</div>
</div>
</nav>
</div>
Here is my css:
.icon--house, .modal button, article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block
}
.navbar-default {
background-color: #030303 !important;
border: #030303;
}
.nav > li > a {
padding: 25px 20px;
font-size: 16px;
}
/* bigger menu items in dropdown */
.dropdown-menu > li > a {
padding: 20px;
}
/* removes whitespace in dropdown from navbar */
.dropdown-menu {
padding: 0;
float: right;
left: 50% !important;
right: auto !important;
text-align: center !important;
transform: translate(-50%, 0) !important;
}
.dropdown:hover .dropdown-menu {
display: block;
}
.dropdown-menu>li>a:hover {
color: #FFF;
background-color: #da1a32;
text-decoration: none;
}
.navbar .navbar-nav > li > a {
color: #FFF !important;
border-bottom: transparent solid 3px;
padding-bottom: 5px;
}
.navbar .navbar-nav > li > a:hover {
border-bottom: #da1a32 solid 3px;
}
a:link {
text-decoration: none;
color: #FFF !important;
}
a:visited {
text-decoration: none;
color: #FFF;
}
a:hover {
text-decoration: none;
color: #FFF;
}
a:active {
text-decoration: none;
color: #FFF;
}
.align-center, .missing {
text-align: center
}
body {
font-family: Montserrat, sans-serif;
font-weight: 300;
line-height: 1.4;
color: #202020;
overflow-x: hidden
}
img {
max-width: 100%;
height: auto
}
a {
transition: .3s ease;
text-decoration: none
}
h1 {
font-size: 30px;
line-height: 1.1;
margin-bottom: .5em
}
this is what I want it to appear like:
And this is what It looks like overlapping the actual navbar:
I've tried some different things such as adding a margin to the bottom of my header but it did not help. If anyone could help it would be greatly appreciated, as I'm not sure where to go from here. If you could also tell me exactly what css it was that needed to be change that would be great. Thanks.
You just need to adjust the 'top' value on the .dropdown-menu class, which is absolute positioned. probably at 100% now
.dropdown-menu {
top: 100%;
}
this will make it line up with the bottom of the li.dropdown > a element,
so if you have 20 extra px of black background from navbar padding, try this:
.dropdown-menu {
top: calc(100% + 20px);
}

Font-Awesome Icon Hover Issue

I have made a menu with Bootstrap and FontAwesome. I want to change the color of all the social media icons to their original colors. Below is the snippet:
HTML
<nav class="navbar navbar-fixed-top" style="border-top:2px solid #CC0033;border-bottom:2px solid #CC0033;">
<div class="container">
<div class="navbar-header">
<button aria-controls="navbar" aria-expanded="false" data-target="#navbar" data-toggle="collapse" class="navbar-toggle collapsed" type="button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!--<div class="navbar-collapse collapse" id="navbar">-->
<div class="navbar-collapse collapse" id="navbar">
<ul class="nav navbar-nav navbar-left">
<li class="active">Home</li>
<li>About</li>
<li>Contact</li>
<li class="dropdown">
<a aria-expanded="true" aria-haspopup="true" role="button" data-toggle="dropdown" class="dropdown-toggle" href="#">Dropdown</a>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider" role="separator"></li>
<li class="dropdown-header">Nav header</li>
<li>Separated link</li>
<li>One more separated link</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><i class="fa fa-facebook-square social-icon"></i></li>
<li><i class="fa fa-twitter-square social-icon"></i></li>
<li><i class="fa fa-instagram social-icon"></i></li>
<li><i class="fa fa-pinterest-square social-icon"></i></li>
<li><i class="fa fa-youtube-square social-icon"></i></li>
<li><i class="fa fa-google-plus-square social-icon"></i></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
CSS
.navbar .navbar-nav > li
{
border: 0px !important;
}
.navbar .navbar-nav > li > a
{
color: #CC0033 !important;
font-family: 'Open Sans', sans-serif;
font-weight: bold;
font-size: 16px;
}
.navbar .navbar-nav > li > a:hover
{
color: #FFFFFF !important;
font-family: 'Open Sans', sans-serif;
font-weight: bold;
font-size: 16px;
background-color: #CC0033 !important;
}
.fa { font-family: 'FontAwesome' !important; }
.social-icon
{
color: #CC0033 !important;
font-size:25px !important;
}
.navbar .navbar-nav > li > a.twitter:hover
{
color: #00ACED !important;
}
Here is a non-working Demo
On hover the icon shall display like this:
For hover I have put the following CSS:
.navbar .navbar-nav > li > a.twitter:hover
{
color: #00ACED !important;
}
How can I achieve the same? Any help will be appreciated.
also try this
.navbar .navbar-right > li > a:hover{
color: #fff !important;
}
.navbar .navbar-right > li > a:hover .fa{
color: #fff !important;
}
Just remove the following code:
.navbar .navbar-nav > li > a:hover {
/* background-color: #CC0033 !important; */
}
The background-color is over shadowing the color of your font awesome icons, hence they are not visible on hover.
Instead if you want to change the color of your font awesome icons on hover use the following code:
.navbar .navbar-nav > li > a:hover > i {
color: #00abf1 !important;
}
EDIT
To change the background-color of the li to white, just remove the following code:
nav > li > a:hover {
/* background-color: #eee; */
}
You can achieve the desired effect by changing these two lines--
.navbar .navbar-nav > li > a:hover > i {
color: #00abf1 !important;
}
.navbar .navbar-nav > li > a:hover {
background-color: white !important;
}
In this way you can change the background-color of li to white.
.navbar .navbar-nav > li
{
border: 0px;
}
.navbar .navbar-nav > li > a
{
color: #CC0033;
font-family: 'Open Sans', sans-serif;
font-weight: bold;
font-size: 16px;
}
.navbar .navbar-nav > li > a:hover
{
color: #FFFFFF;
font-family: 'Open Sans', sans-serif;
font-weight: bold;
font-size: 16px;
background-color: #CC0033 !important;
}
.fa { font-family: 'FontAwesome' !important; }
.social-icon
{
color: #CC0033;
font-size:25px;
}
.navbar .navbar-nav > li > a:hover > i {
color: #00abf1 !important;
}
.navbar .navbar-nav > li > a:hover {
background-color: white !important;
}
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style type="text/css">
</style>
<script type="text/javascript">
</script>
</head>
<body>
<nav class="navbar navbar-fixed-top" style="border-top:2px solid #CC0033;border-bottom:2px solid #CC0033;">
<div class="container">
<div class="navbar-header">
<button aria-controls="navbar" aria-expanded="false" data-target="#navbar" data-toggle="collapse" class="navbar-toggle collapsed" type="button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!--<div class="navbar-collapse collapse" id="navbar">-->
<div class="navbar-collapse collapse" id="navbar">
<ul class="nav navbar-nav navbar-left">
<li class="active">Home</li>
<li>About</li>
<li>Contact</li>
<li class="dropdown">
<a aria-expanded="true" aria-haspopup="true" role="button" data-toggle="dropdown" class="dropdown-toggle" href="#">Dropdown</a>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider" role="separator"></li>
<li class="dropdown-header">Nav header</li>
<li>Separated link</li>
<li>One more separated link</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><i class="fa fa-facebook-square social-icon"></i></li>
<li><i class="fa fa-twitter-square social-icon"></i></li>
<li><i class="fa fa-instagram social-icon"></i></li>
<li><i class="fa fa-pinterest-square social-icon"></i></li>
<li><i class="fa fa-youtube-square social-icon"></i></li>
<li><i class="fa fa-google-plus-square social-icon"></i></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</body>
</html>
Hope this helps!
If you replace this code:
.navbar .navbar-nav > li > a.twitter:hover
{
color: #00ACED !important;
}
With this:
.navbar .navbar-nav li a:hover > .fa-twitter-square { color: #00ACED !important; }
Than it should working, good luck!
Simply replace this
.navbar .navbar-nav > li > a:hover
{
color: #FFFFFF !important;
font-family: 'Open Sans', sans-serif;
font-weight: bold;
font-size: 16px;
background-color: #CC0033 !important;
color: #00aced
}
by this
.navbar .navbar-nav > li > a:hover
{
color: #FFFFFF !important;
font-family: 'Open Sans', sans-serif;
font-weight: bold;
font-size: 16px;
background-color: #CC0033;
color: #00aced
}
and add this
.navbar .navbar-right > li > a:hover{
background-color: #fff
}
.navbar .navbar-right > li > a.twitter:hover i{
color: #00aced !important;
}
All the best :)
Add this to your css code:
.social-icon:hover {
color: white!important;
}
Works for me that way...

In navbar glyphicon is not showing properly(Bootstrap)

I am trying to create a navbar using bootstrap.But the home icon in navbar is not showing properly.It is not in middle and not in parallel with other list.Please help me to solve this.
Problem:
HTML:
<nav class="navbar navbar-inverse">
<div class="container">
<div class="row">
<nav class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li>
<a href="#" class="navbar-brand text-center">
<span class="glyphicon glyphicon-home"></span>
</a>
</li>
<li class="active">
<a href="#">Avro keyboard<br/>
<small>For windows</small>
</a>
</li>
<li>
<a href="#">iAvro<br/>
<small>For Mac OS X</small>
</a>
</li>
<li>
<a href="#">ibus-avro<br/>
<small>for linux</small>
</a>
</li>
<li>
<a href="#">Bangla Fonts<br/>
<small>Unicode/ANSI fonts</small>
</a>
</li>
<li>
<a href="#">Others<br/>
<small>Misc goodies</small>
</a>
</li>
<li>
<a href="#">Blog<br/>
<small>Stay updated!</small>
</a>
</li>
<li>
<a href="#">Help and support<br/>
<small>Forum & Help files</small>
</a>
</li>
<li>
<a href="#">Developers<br/>
<small>repositories and resources</small>
</a>
</li>
</ul>
</nav>
</div>
</div>
</nav>
CSS:
li {
border-left: 1px solid;
border-top: 0px;
border-right: 1px solid;
border-bottom: 0px;
border-style: solid;
border-color: #545454;
}
a {
color: #FFFFFF !important;
}
small {
color: #C5C6C1;
font-style: italic;
}
You can apply any changes to the CSS rule below:
.navbar-inverse .navbar-brand .glyphicon{
padding: 5px 0 0 15px;
}
.navbar {
border-radius: 0;
}
.navbar-inverse .navbar-header .navbar-brand {
color: #FFFFFF;
}
.navbar-inverse .navbar-nav > li:first-child {
border: none;
padding-top: 10px;
}
.navbar-inverse .navbar-nav {
border-left: 1px solid #545454;
}
.navbar-inverse .navbar-nav > li {
border: none;
border-left: 1px solid #545454;
border-right: 1px solid #545454;
}
.navbar-inverse ul.navbar-nav > li > a {
color: #FFFFFF;
}
small {
color: #C5C6C1;
font-style: italic;
}
#media (min-width: 1200px) {
.navbar .navbar-nav {
display: inline-block;
float: none;
vertical-align: top;
}
.navbar .navbar-collapse {
text-align: center;
}
.navbar-inverse .navbar-header a {
display: none;
}
}
#media (max-width: 1200px) {
.navbar-inverse .navbar-nav > li:first-child {
display: none;
}
.navbar-inverse .navbar-nav {
border: none;
}
.navbar-inverse .navbar-brand {
line-height: 0;
}
.navbar-inverse .navbar-nav > li {
border: none;
}
.navbar-inverse .navbar-header {
float: none;
}
.navbar-inverse .navbar-left,
.navbar-right {
float: none !important;
}
.navbar-inverse .navbar-toggle {
display: block;
}
.navbar-inverse .navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.navbar-fixed-top {
top: 0;
border-width: 0 0 1px;
}
.navbar-inverse .navbar-collapse.collapse {
display: none !important;
}
.navbar-inverse .navbar-nav {
float: none !important;
margin-top: 7.5px;
}
.navbar-inverse .navbar-nav > li {
float: none;
}
.navbar-inverse .navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
}
.navbar-inverse .collapse.in {
display: block !important;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<nav class="navbar navbar-inverse">
<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" aria-expanded="false"> <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" href="#"> <span class="glyphicon glyphicon-home"></span>
</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">
<li> <a href="#"><span class="glyphicon glyphicon-home"></span>
</a>
</li>
<li class="active"> <a href="#">Avro keyboard<br/>
<small>For windows</small>
</a>
</li>
<li> <a href="#">iAvro<br/>
<small>For Mac OS X</small>
</a>
</li>
<li> <a href="#">ibus-avro<br/>
<small>for linux</small>
</a>
</li>
<li> <a href="#">Bangla Fonts<br/>
<small>Unicode/ANSI fonts</small>
</a>
</li>
<li> <a href="#">Others<br/>
<small>Misc goodies</small>
</a>
</li>
<li> <a href="#">Blog<br/>
<small>Stay updated!</small>
</a>
</li>
<li> <a href="#">Help and support<br/>
<small>Forum & Help files</small>
</a>
</li>
<li> <a href="#">Developers<br/>
<small>repositories and resources</small>
</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>