0

I have some text that I rotate and fade in. My problem is the text has no colour, and I would like to make it blue.

As you can see, I do assign a color attribute to the rubber class, but it does not seem to be taking effect.

Please can anyone advise how I can change my css to achieve this? Thank you

.rubber {
  padding: 5px 2px;
  color: blue;
  font-family: 'Black Ops One', cursive;
  text-transform: uppercase;
  text-align: center;
  width: 155px;
  transform: rotate(-10deg);
}
// fade-in
 .fade-in p {
  margin-top: 25px;
  text-align: center;
  animation: fadein 8s;
  -moz-animation: fadein 8s;
  /* Firefox */
  -webkit-animation: fadein 8s;
  /* Safari and Chrome */
  -o-animation: fadein 8s;
  /* Opera */
}
@keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.8;
  }
}
@-moz-keyframes fadein {
  /* Firefox */
  from {
    opacity: 0;
  }
  to {
    opacity: 0.8;
  }
}
@-webkit-keyframes fadein {
  /* Safari and Chrome */
  from {
    opacity: 0;
  }
  to {
    opacity: 0.8;
  }
}
@-o-keyframes fadein {
  /* Opera */
  from {
    opacity: 0;
  }
  to {
    opacity: 0.8;
  }
}
<div class="rubber fade-in">
  <p>Job Offered</p>
</div>
Federico
  • 1,392
  • 1
  • 17
  • 40
Richard
  • 8,193
  • 28
  • 107
  • 228

2 Answers2

3

Please replace // fade-in with /* fade-in */ . In css to add comment line you should use /* comment here */

Here is the working code

.rubber {
  padding: 5px 2px;
  color: blue;
  font-family: 'Black Ops One', cursive;
  text-transform: uppercase;
  text-align: center;
  width: 155px;
  transform: rotate(-10deg);
}
/* fade in */
.fade-in  p{
    margin-top: 25px;
    text-align: center;
    animation: fadein 8s;
    -moz-animation: fadein 8s; /* Firefox */
    -webkit-animation: fadein 8s; /* Safari and Chrome */
    -o-animation: fadein 8s; /* Opera */
}
@keyframes fadein {
    from {
        opacity:0;
    }
    to {
        opacity:0.8;
    }
}
@-moz-keyframes fadein { /* Firefox */
    from {
        opacity:0;
    }
    to {
        opacity:0.8;
    }
}
@-webkit-keyframes fadein { /* Safari and Chrome */
    from {
        opacity:0;
    }
    to {
        opacity:0.8;
    }
}
@-o-keyframes fadein { /* Opera */
    from {
        opacity:0;
    }
    to {
        opacity:0.8;
    }
}
<div class="rubber fade-in"><p>Job Offered</p></div>
Sa Si Kumar
  • 652
  • 1
  • 5
  • 12
  • thank you. I think my problem is with some other element in the DOM affecting it. I have tried this with now success though: `color: blue !important;` – Richard Nov 11 '16 at 08:03
  • Apologies, I needed to reload. `!important` did work. – Richard Nov 11 '16 at 08:06
1

I tried your code in jsfiddle as well as it normal HTML page. Only problem was with the comment in css style tag use this format

/ Shift+8 comment Shift+8/

Vinod kumar G
  • 639
  • 6
  • 17