How to set the text color in CSS – change the text color with styles
Answer to the question
So the answer to the question “How to change the color of text in CSS” is pretty simple – with the color property. It’s enough to set to the desired selector (element, class, idi, etc.) the color property with a certain value. Most often, in practice, it looks like this:
This is how we set the white text color for all the <p> blocks.
What you should pay attention to – the color can be specified in different formats.
For example, instead of #ffffffff you can write white and the color will still be white. Or instead of six symbols f you can write only three – it will still work. You can also specify a color using the RGB system. That’s when you mix the three colors (red, green and blue), to get one. Then the format will be like this:
The color is still the same white.
How to set text transparency
To set transparency for text, it is enough to use an extended version of rgb – rgba. Here we set the fourth parameter transparency (from 0 to 1). Here, for illustration, let’s make the black text a little bit transparent:
We hope that you got the answer to your question and now you will be able to change the color of text on your site without any problems.