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)
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)
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)
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)
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)
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)
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.