I have a social bar that has grey margin, I have been trying to make it (margin) red when user passes mouse over it.
Can anyone help me with this?
Even !important does not worked.
PS: I am using bootstrap
footer {
background-color: black;
}
.foot {
font-family: 'Josefin Sans', sans-serif;
font-style: normal;
font-weight: 300;
font-size: 21px;
line-height: 36px;
color: #e0e1d7;
}
a:link {
color: white;
}
a:hover {
color: red;
text-decoration: none;
}
.container-fluid {
padding-right: 0;
padding-left: 0;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
max-width: 100%;
}
.copyright {
font-family: Arial;
font-style: normal;
font-weight: 400;
font-size: 15px;
line-height: 18px;
color: #4b4b4b;
}
.list-inline-item {
color: white;
}
.fab {
background-color: grey;
padding: 4px 5px;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<footer>
<div class="container-fluid text-center text-white">
<div class="row">
<div class="col-sm-12">
<img src="../../assets/footer.png" alt="black tint">
<div class="foot pt-5 pb-2">
<ul>
<a href="http://www.pinterest.com"><li class="list-inline-item mx-2"><i class="fab fa-pinterest-p"></i></li></a>
<a href="http://www.facebook.com"><li class="list-inline-item mx-2"><i class="fab fa-facebook-f"></i></li></a>
<a href="http://www.linkedin.com"><li class="list-inline-item mx-2"><i class="fab fa-linkedin-in"></i></li></a>
<a href="http://www.blog.com"><li class="list-inline-item mx-2"><i class="fab fa-blogger-b"></i></li></a>
<a href="http://www.twitter.com"><li class="list-inline-item mx-2"><i class="fab fa-twitter"></i></li></a>
<a href="http://www.youtube.com"><li class="list-inline-item mx-2"><i class="fab fa-youtube"></i></li></a>
</ul>
<p class="copyright">Copyright © 2013 WEUSTHEM INC. ALL RIGHTS RESERVED.</p>
</div>
</div>
</div>
</div>
</footer>
5
Answers
use id=subbtn in js where you want to hover and write this code in css or if you want to write in jsp put it under style,change the color name whatever you want ,I am 100% sure it will work fine
added
in-place of
You have to use the a hyperlink inside the
li
and also add the parent class(footer li a:hover)
to overwrite bootstrap default css. I hope this answer will be helpful.Changing the
a:hover
intoa>li>i:hover
would change on:hover
of your social bar. Reason being the structure of your HTML code wasa
tag thenli
theni
.I would say if you had a specific class for differentiating
a>li>i
of your social bar and othera>li>i
if you do have one, you could add class to differentiate them. Example:a>li>i.social
. Don’t forget if you do so add thesocial
class into thei
you can achieve this by adding parent element class with this,
Since the “fab” class background already set to gray color and you won’t get any changes for the a:hover color or background since the “.fab” class is inside the “a” tag