This post originated from an RSS feed registered with Java Buzz
by dion.
Original Post: Default text in CSS
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
Latest Java Buzz Posts
Latest Java Buzz Posts by dion
Latest Posts From techno.blog(Dion)
Advertisement
When we style something in CSS, we can put images as backgrounds, font colors, alignment, and much more.
If I can assign images to an element, why not some text?
How about if we could say "this id or class has the default text of FOO". We can take the DRY principle and take it to CSS.
We get to set default text in a site/application wide CSS file, and share this throughout.
.nosuch {
text-content: "some default text";
}
We could also give default pre-text (always put "Error: " before anything in the error class).
A slight abuse of CSS? Totally, but could be useful! :)
This could even be implemented a little via JavaScript behaviour (not with nice CSS syntax).
Read: Default text in CSS