Forum Moderators: not2easy

Message Too Old, No Replies

Inserting Text

         

sumitra

12:20 pm on Mar 18, 2008 (gmt 0)

10+ Year Member



Hello,

Can we insert text to html page through css? I didnt find any option.. I think its not possible.. but if there is any option inserting text (like value, caption etc.. are not available in css ) pls let me know.

Thanks!

alias

12:31 pm on Mar 18, 2008 (gmt 0)

10+ Year Member



yes, you actually can.

p:before {content: "I'm before!"};

google for "css before after pseudo selectors".

but it's only available in CSS2 - which is not yet supported by the majority of the browsers, so rather not YET usable.

sgietz

1:56 pm on Mar 18, 2008 (gmt 0)

10+ Year Member



The idea of inserting content via CSS usually results in cold sweats and intense chest pains among purists.

;)

alias

2:02 pm on Mar 18, 2008 (gmt 0)

10+ Year Member



well it depends on what you want to insert ;)
in most cases it would hopefully be used to insert something simple.

but, well, there are all kinds of web developers out there for sure ;)

sgietz

3:13 pm on Mar 18, 2008 (gmt 0)

10+ Year Member



Oh, I agree. I think this is an extremely useful feature, but as you said, there are lots of folks with lots of opinions.

:)

Xapti

4:31 pm on Mar 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use javascript for inserting text. CSS isn't really for that, and most browsers don't support it well yet anyways. Any text inserted should be unimportant, as to not exclude users with javascript disabled.

swa66

9:37 pm on Mar 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can insert text as noted, and even a purist should have no problem with e.g. inserting a highly style double quote before a class used to represent quotes.
What you can do with characters is probably going to be nicer than what you do with graphics, esp. if you look at scaling it.

sumitra

12:02 pm on Mar 19, 2008 (gmt 0)

10+ Year Member



Thank you very much !