How can I use 2 different styles in the same p?

<p>This is a bold red text</p>

<p color:red,font:bold>This is a bold red text</p>

I tried this way, but not working

How can i fix this prroblem?

>Solution :

You are using style incorrectly, let me show you.

Here are 2 variations on how you can do this.

#1

Correct Style:

<p style="color: red; font-weight: bold;">This is a bold red text </p>

#2

Or you can use classes.

HTML:

<p class="textformatting">This is a bold red text</p>

Style:

.textformatting{
color: red;
font-weight: bold;
}

Leave a Reply