content attribute text color - css

10,094

There are 8 digits in your color:

color:#FFBC0000;

Were your extra two zeroes added by accident?

color:#FFBC00;

Or does the FF represent 100% alpha (completely opaque)? If so, leave it out; CSS hex colors don't support specifying the alpha channel, only the rgba() notation does:

color:#BC0000;
Share:
10,094
dotnetrocks
Author by

dotnetrocks

Updated on June 04, 2022

Comments

  • dotnetrocks
    dotnetrocks over 1 year

    I would like to add color to a text in the content attribute. I did like this, didn't work

     .atleastTwoChars:after
     {
        content: "2*";
        float: left;
        width: 16px;
        height: 14px;
        border: 0;
        margin: 2px 3px 0px 3px;
        color:#FFBC0000;
    }
    
    • Jared Farrish
      Jared Farrish almost 12 years
      At least, this should be: color: #FFBC00;. Note the number of alphanumeric characters (6).
    • noob
      noob almost 12 years
      This is not possible because there is no tag and every style definition should be related to a tag.
    • BoltClock
      BoltClock almost 12 years
      @micha: What are you talking about?
    • Jared Farrish
      Jared Farrish almost 12 years
      @micha - :after is an element. See mesiesta's answer.
  • noob
    noob almost 12 years
    A answer shouldn't be a question...?
  • BoltClock
    BoltClock almost 12 years
    OK, I made it a little less interrogative.