On 21 jan, 22:23, Pion <onlee2...@gmail.com> wrote:
> I have the following code snippet on GWT 2.0:
>
>             Anchor anchor = new Anchor("Foo", "http://www.foo.com";);
>             anchor.addStyleName("anchor");
>
> Also, I have the following CSS snippet
>
> /* test 1 */
> .anchor {
>         color:red;
>
> }
>
> The current behavior:
>
> o The color is red  before clicking "Foo". It works as expected.
> o The color is blue after    clicking "Foo". I was expecting it to be
> still red.
>
> I tried
>
> /* test 2 */
> .anchor a {
>         color:red;
>
> }
>
> and
>
> /* test 3 */
> .anchor a:link a:visited {
>         color:red;
>
> }
>
> Test 1, 2 and 3 change the color after the user click "Foo"..
>
> How can I keep the color red before and after clicking "Foo"?
>
> Thanks in advance for your help.

.anchor *is* the <a>, so you'd have to write either of:

   .anchor:visited {...}
   a.anchor:visited {...}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to