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;
Author by
dotnetrocks
Updated on June 04, 2022Comments
-
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 almost 12 yearsAt least, this should be:
color: #FFBC00;
. Note the number of alphanumeric characters (6). -
noob almost 12 yearsThis is not possible because there is no tag and every style definition should be related to a tag.
-
BoltClock almost 12 years@micha: What are you talking about?
-
Jared Farrish almost 12 years@micha -
:after
is an element. See mesiesta's answer.
-
-
noob almost 12 yearsA answer shouldn't be a question...?
-
BoltClock almost 12 yearsOK, I made it a little less interrogative.