0

Need to color a paragraph with 2 different colors in the ratio of 1:1 or 50%-50% text of the paragraph. We can not use any other tags,inline css or any other scripting or programming language. which syntax of CSS should I use.

I have tried pseudo classes like ::first-letter and ::first-line but we need to color the text in the 50%-50% ratio.

1 Answers1

2

I hacked this one

Changing text color on 2 sides of diagonal gradient line in html

div {
  width: 290px;
  font-size: 20px;
  background: -webkit-linear-gradient(190deg, red 50%, orange 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
<div>This text needs to fill 100% to work</div>
mplungjan
  • 169,008
  • 28
  • 173
  • 236