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>
tag wouldn't go inside of the css style.
– WTFranklin Mar 12 '20 at 15:37Test
` **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