jeudi 5 avril 2018

How to change color in horizontal icon bar

I want to be able to change to color of either the green home icon or the green search icon. But whenever I try to change it, it changes it for both of them. I'm not sure if I've explained this well, but any comments or ideas would be appreciated. Thanks

console.log('Loaded')
.button {
  display: inline-block;
  border-radius: 4px;
  background-color: #4CAF50e;
  border: none;
  
  text-align: center;
  font-size: 28px;
  padding: 20px;
  width: 200px;
  transition: all 0.5s;
  cursor: pointer;
  margin: 5px;
}

.button span {
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: 0.5s;
}

.button span:after {
  content: '\00bb';
  position: absolute;
  opacity: 0;
  top: 0;
  right: -20px;
  transition: 0.5s;
}

.button:hover span {
  padding-right: 25px;
}

.button:hover span:after {
  opacity: 1;
  right: 0;
}


body {margin:10}

.icon-bar {
    width: 90px;
        height: 100%;
    background-color: #555;   /*button color*/
}

.icon-bar a {
    display: block;
    text-align: center;
    padding: 16px;
    transition: all 0.3s ease;
    color: white;
    font-size: 36px;
}

.icon-bar a:hover {
    background-color: #4289b5;
}

.active {
    background-color: #4CAF50 !important;
}























body{
  font-size: 20px;
  font-family: Roboto;
  font-weight: 300;
}

a{
  
  text-decoration: none;
  ;
  padding: 10px 15px;
  line-height: 3;
  -webkit-transition: all .3s ease;
           -moz-transition: all .3s ease;
            -ms-transition: all .3s ease;
             -o-transition: all .3s ease;
                                  transition: all .3s ease;
}

a:hover{
  color: #FFF;
  background: #FC2121;
  -webkit-transition: all .3s ease;
           -moz-transition: all .3s ease;
            -ms-transition: all .3s ease;
             -o-transition: all .3s ease;
                                  transition: all .3s ease;  
}

/* Search Style */ 
#search {
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    -webkit-transition: all 0.5s ease-in-out;
       -moz-transition: all 0.5s ease-in-out;
        -ms-transition: all 0.5s ease-in-out;
               -o-transition: all 0.5s ease-in-out;
            transition: all 0.5s ease-in-out;
    -webkit-transform: translate(0px, -100%) scale(0, 0);
             -moz-transform: translate(0px, -100%) scale(0, 0);
              -ms-transform: translate(0px, -100%) scale(0, 0);
         -o-transform: translate(0px, -100%) scale(0, 0);
                  transform: translate(0px, -100%) scale(0, 0);    
    opacity: 0;
    display: none;
}

#search.open {
    -webkit-transform: translate(0px, 0px) scale(1, 1);
       -moz-transform: translate(0px, 0px) scale(1, 1);
          -ms-transform: translate(0px, 0px) scale(1, 1);
               -o-transform: translate(0px, 0px) scale(1, 1);
                   transform: translate(0px, 0px) scale(1, 1); 
    opacity: 1;
    z-index: 106;
    display: block;
}

#search input[type="search"] {
    position: absolute;
    top: 50%;
    left: 0;
    margin-top: -51px;
    width: 60%;
    margin-left: 20%;
    color: rgb(255, 255, 255);
        background: transparent;
        border-top: 1px solid rgba(255, 255, 255, .8);
        border-bottom: 2px solid rgba(255, 255, 255, .5);
        border-left: 0px solid transparent;
        border-right: 0px solid transparent;
    font-size: 40px;
        font-family: Roboto;
    font-weight: 300;
    text-align: center;
    outline: none;
        padding: 10px;
}
  
#search .close {
    position: fixed;
    top: 15px;
    right: 15px;
          opacity: 1;
          font-size: 27px;
        color: #fff;
}

#search .close:hover{
  color: #FC2121;
  cursor: pointer;
}








body {margin:0;}

.icon-bartop {
    width: 100%;
    background-color: #555;
    overflow: auto;
}

.icon-bartop a {
    float: left;
    width: 20%;
    text-align: center;
    padding: 12px 0;
    transition: all 0.3s ease;
    color: white;
    font-size: 36px;
}

.icon-bartop a:hover {
    background-color: #000;
}

.active {
    background-color: #4CAF50 !important;
}
<!DOCTYPE html>
<html>
<body>
<html lang="en">

<head>
  <title>Web Scraper</title>
  <script src="https://cdn.jsdelivr.net/npm/sweetalert"></script>
  <link rel="stylesheet" href="css/style.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  <script src="js/scripts.js"></script>
  <meta name="viewport" content="width=device-width, initial-scale=1">

</head>

<body>

<body>

<div class="icon-bartop">
  <a class="active" href="#"><i class="fa fa-home"></i></a> 
  <a href="#"><i class="fa fa-search"></i></a> 
  <a href="#"><i class="fa fa-envelope"></i></a> 
  <a href="#"><i class="fa fa-globe"></i></a>
  <a href="#"><i class="fa fa-trash"></i></a> 
</div>




<div class="sidebar">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <div class="icon-bar">
          <a class="active" href=""><i class="fa fa-search"></i></a> 
          <a href=""><i class="fa fa-bitcoin"></i></a> 
          <a href=""><i class="fa fa-map"></i></a> 
          <a href=""><i class="fa fa-anchor"></i></a>
          <a href=""><i class="fa fa-shopping-cart"></i></a> 
        </div>
</div>



<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Roboto:300' rel='stylesheet' type='text/css'>





</body>

</html>



Aucun commentaire:

Enregistrer un commentaire