tags:

views:

56

answers:

4

Can I put text in my CSS file , and have that text be visible in the displayed HTML?

+3  A: 

You can use the content property.

Douglas
Just remember that it won't work in IE6, IE7, and IE8 will only work if you're properly including a DOCTYPE.
ceejayoz
A: 

I have a question though. Why would you ever want to do this. Isn't the whole point of CSS to keep styling seperate from the HTML?

Matt
This seems to be a comment, not (even an attempt at) an answer.
Jerry Coffin
You might want to use the content property to insert the URL of a link after the link text in a print stylesheet.
Chris Cox
Another use is to embed real quotation marks around something marked up with the <q> tag. Though I admit that the author of the question probably isn't thinking of something that subtle....
Douglas
A: 

The content property is a good way of doing this. But make sure you use a !DOCTYPE tag or theres a good chance it won't work in IE8.

Blake
But I can't use 2 of this in one page.. stuped HTML why don't have p1,p2,p3....p54, like h1-h6
Kaloyan Siderov
Because a hierarchy of headings makes sense and a hierarchy of paragraphs … doesn't.
David Dorward
A: 

OK! Can I use Java Script ?

Kaloyan Siderov
This doesn't seem to be an answer. It also seems to suggest that the original question is an X-Y problem: http://mywiki.wooledge.org/XyProblem
David Dorward