0

I found this example:

http://www.w3schools.com/cssref/tryit.asp?filename=trycss_sel_after

but instead of p having a separate css stylesheet, I want to do it in one like:

<p style = ":before:content: HELLO">My name is Donald</p>

OR

<p style = :before {content: HELLO}>I live in Ducksburg</p>

Is something like this possible? What is a correct way of doing it? I'm trying to use 'content' CSS property if possible.

J L
  • 2,157
  • 3
  • 16
  • 15
  • You can have it as embedded style if you want. – Sarbbottam Aug 15 '14 at 00:55
  • No, that is not possible using inline styles. (If you want it “inline”, you could make it _actual_ content of the element in the first place …) – CBroe Aug 15 '14 at 00:57
  • However you set the `content` property, its value needs to be quoted. –  Aug 15 '14 at 02:24

1 Answers1

0

You can't set such properties inline.

There was a method in the past, but it no longer works in modern browsers.

How to write a:hover in inline CSS?

Community
  • 1
  • 1
RobertO
  • 2,655
  • 1
  • 20
  • 18