styling css text | css text styles
We use text in HTML to convey messages, tell about yourself, and literally many more. Without text, your website will definitely look dull unless you want to use your website to show any photos, etc.
Generally, the text on your HTML site is black in color in default. However, with the power of CSS, we can configure it to make it much more beautiful.
Element or Class?
We can style text using CSS but we need to decide what to use. Do you want to style by using the HTML tag as the selector or give a class or id for your text and then style it?
In today’s demo, to make things simple, I will be using the HTML tag itself to style as the selector. Let’s move on.
Okay, now let’s move on to styling it.
css text Color Change
we can first try changing the color of the text. This is possible by using the CSS color property. We will change its color to a red color. Look at the code block below for a better understanding.
css text Background Color
Now let’s add some background color for a nice highlight effect or just for design. we will use the background-color property for this. Look at the code block below for more:
css text Underline Effect
You can do a lot more!
These were just some basic examples. With the power of CSS through properties like padding, center text-align, etc you can style your text to look even more awesome. Below I’m going to show a code block example where I’ve added several more CSS properties.
Check it more
In this post, we learn how to style text with CSS . If we made a mistake or any confusion, please drop a comment to reply or help you in easy learning.