What I am looking for:
A way to style one HALF of a character. (In this case, half the letter being transparent)
Wh
You can use below code. Here in this example I have used h1
tag and added an attribute data-title-text="Display Text"
which will appear with different color text on h1
tag text element, which gives effect halfcolored text as shown in below example
body {
text-align: center;
margin: 0;
}
h1 {
color: #111;
font-family: arial;
position: relative;
font-family: 'Oswald', sans-serif;
display: inline-block;
font-size: 2.5em;
}
h1::after {
content: attr(data-title-text);
color: #e5554e;
position: absolute;
left: 0;
top: 0;
clip: rect(0, 1000px, 30px, 0);
}
Display Text