On Jul 30, 2005, at 11:57, Jan Bares wrote:

label:after           { content: ":"; }
label.required:before { content: "*"; }
label.error           { font-style: italic;  color: red;}

Neat solution. However, what about IE that doesn't support content?

Yeah, I know... the webdesigner's curse... Didn't build a good workaround for that one yet. You could go two routes, I guess. The first one is to forget about fancy CSS stuff and just put the "*" and ":" in the FieldLabel logic. This is the easiest workaround, but it breaks the semantics of your markup.

The second option I see is somewhat more involved, but would probably be considered The Right Thing, since it leaves your markup intact and only kicks in when its needed (when the page is viewed with IE): Write some javascript that runs only when IE is used - there are all kinds of tricks to selectively use CSS or javascript on a particular browser. That script would search the page's DOM tree for elements with the "error" or "required" class attributes and add the "*" or ":" to the element's contents. Call the script with a onLoad trigger and presto...

You can find similar tricks and discussion on CSS based web design on sites like www.zeldman.com and www.alistapart.com.

Please note that I didn't try the technique mentioned above, but I guess it could work.

cheers,
Gert Jan


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to