i want to change the color of only one word in string of text using stylus i.e.
#copy
h1 Our new site will be ready soon..
the stylus code is
h1
font-weight bold
color white
i just want to change the color of the first letter in the h1 phrase "Our" into yellow how could i achieve that in stylus, thanks :)
The css selector "first-letter" selector is a good option.
If you want to change other letters or parts of text as per your example, use a span with its own style, e.g.
<h1><span style="color:yellow">O</span>ur <span style="color:blue">new</span> website</h1>
You can try the :first-letter selector:
h1:first-letter
color: yellow
Here's a fiddle with an example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With