-1

Code I'm trying to change

I have tried the following code to change the p text without any success, I'm not sure how to call the p in order to change the text, how do I call this?

p.min-pariticipants  { 

font-weight: bold;
color: red;
font-size: 30px;

<p> Test </p>

}
Ray
  • 1
  • 1
    You're trying to change the text or style of the text? The

    tag wouldn't go inside of the css style.

    – WTFranklin Mar 12 '20 at 15:37
  • Changing the **text** using CSS???? This doesn't make sense! – Alon Eitan Mar 12 '20 at 15:41
  • CSS can't manipulate the content of HTML tags. You can only ADD content before or after the HTML content. – Bryce Howitson Mar 12 '20 at 15:42
  • Is your CS loading before or after WordPress'? What's WordPress' specificity on that class? – j08691 Mar 12 '20 at 15:44
  • 1
    I don't think the OP is trying to change the text content but rather change the styling. I could be wrong but I think they just phrased their question poorly – j08691 Mar 12 '20 at 15:46
  • But they did add `

    Test

    ` **inside** the css style, that's why I think this is quite literally what the OP is trying to do
    – Alon Eitan Mar 12 '20 at 15:50

1 Answers1

2

I'm not sure what you're actually trying to accomplish; but writing HTML inside CSS is a no go. If you're trying to change the contents of the p tag and you don't have access to the actual HTML; then you can use a small line JavaScript to accomplish this.

document.getElementById('test').innerText = "Change Me!"
<p id="test">Lorem Ipsum</p>

If you're looking to add additional content to the p tag, then you can use the CSS pseudo selectors ::after or ::before; this will put new content alongside the pre-existing one.

#test::after {
  content:' After'
}
#test::before {
  content:'Before '
}
<p id="test">Lorem Ipsum</p>
MattHamer5
  • 1,431
  • 11
  • 21