Q:

How do I color multiple line of text under a specific paragraph in CSS?

I am trying to set a color of paragraphs without the use of selections of divs to basically style the paragraph. Could anyone help solve my issue with paragraph colors?
Basically, I want to use combinations or child sectors in CSS if possible to have multiple lines of paragraph to be a color under a belonging to the headers for example under h3 headers only show blue color paragraphs and h4 headers only show red color paragraphs.

h3 {
  color: lime;
}

h3 ~ p {
  color: blue;
}

h4 {
  color: Orange;
}

h4 ~ p {
  color: red;
}
<h3>Heading 1</h3>
<p>This section of the paragraphs only to be shown as blue...</p>
<p>This section of the paragraphs only to be shown as blue...</p>

<h4>Heading 2</h4>
<p>This section of the paragraphs only to be shown as red...</p>
<p>This section of the paragraphs only to be shown as red...</p>

<h3>Heading 1 (Again)</h3>
<p>This section of the paragraphs only to be shown as blue...</p>
<p>This section of the paragraphs only to be shown as blue...</p>

A:

You can use the + selector instead of ~ so you can target only the needed p and avoid specifity/order issue:

h3 + p,
h3 + p + p{
    color: blue;
}

h4 + p,
h4 + p + p{
    color: red;
}
<h3>Heading 1</h3>
<p>This section of the paragraphs only to be shown as blue...</p>
<p>This section of the paragraphs only to be shown as blue...</p>

<h4>Heading 2</h4>
<p>This section of the paragraphs only to be shown as red...</p>
<p>This section of the paragraphs only to be shown as red...</p>

<h3>Heading 1 (Again)</h3>
<p>This section of the paragraphs only to be shown as blue...</p>
<p>This section of the paragraphs only to be shown as blue...</p>

Or you can consider a more complex selector using ~ if the number of p is undefined (the order of the CSS is important here)

h3 ~ p{ /*target the first ones*/
    color: blue;
}

h4 ~ p{ /*target the next ones*/
    color: Orange;
}

h4 ~ h3 ~ p { /*target the last ones*/
    color: red;
}
<h3>Heading 1</h3>
<p>This section of the paragraphs only to be shown as blue...</p>
<p>This section of the paragraphs only to be shown as blue...</p>

<h4>Heading 2</h4>
<p>This section of the paragraphs only to be shown as orange...</p>
<p>This section of the paragraphs only to be shown as orange...</p>
<p>This section of the paragraphs only to be shown as orange...</p>
<p>This section of the paragraphs only to be shown as orange...</p>

<h3>Heading 1 (Again)</h3>
<p>This section of the paragraphs only to be shown as red...</p>
<p>This section of the paragraphs only to be shown as red...</p>
<p>This section of the paragraphs only to be shown as red...</p>

