Home > Software design >  When writing CSS, and you have multiple <P> tags that all need to be separate colors do you ju
When writing CSS, and you have multiple <P> tags that all need to be separate colors do you ju

Time:06-05

When writing CSS, and you have multiple <P> tags that all need to be separate colors do you just keep writing separate <P> selectors or does there need to be a element/selector that separates them?

CodePudding user response:

You could use id such as: <p id="p1"></p> or class such as: <p ></p> on each element or set the style from inside the tag such as <p style="color:black;"></p>. These are as far as I know the only ways you could do what you're hoping for.

CodePudding user response:

I think you need to use Inline CSS for every

like below.

<p style="color:red;">A red paragraph.</p>
<p style="color:green;">A green paragraph.</p>
  • Related