obela06
obela06

Reputation: 335

Two different colors in the same text by using html and css

I want to set two different colors to my text . My text is phrase 1 / phrase2 and i want to set black color to phrase 1 / and green color to phrase2

<label class="diffcolor">pharse1/ phrase2</label>

My example

<label class="diffcolor">pharse1/ </label>

css:

.different::after{
    color : green;
    content :"phrase2";
}

I doesn't work to my internet explorer browser. How can i do this ?

Upvotes: 1

Views: 832

Answers (1)

kelvin
kelvin

Reputation: 1538

label.class { color:#4C4C4C }
span.name { color:#FF0000; }
<label class="diffcolor">pharse1/ <span class="name">phrase2</span></label>

Upvotes: 3

Related Questions