Please cross-link when you cross-post: http://stackoverflow.com/q/22631441/116472
On Tuesday, March 25, 2014 11:18:29 AM UTC+1, Tom wrote:
-- On Tuesday, March 25, 2014 11:18:29 AM UTC+1, Tom wrote:
In Gwt, we have these default css for Anchor:
In css file
.gwt-Anchor:link {color:black;} .gwt-Anchor:visited {color:#00FF00;} .gwt-Anchor:active { color:#0000FF; } .gwt-Anchor:hover { color:#FF00FF; cursor: pointer; cursor: hand; }That means whenever i created a new Anchor, it will use the default.
But i want a custom one with blue color. That is I want everything is exactly the same as default Anchor except that the Anchor is blue.
So I created these:
.blueAnchor:link {color:blue;} .blueAnchor:visited {color:#00FF00;} .blueAnchor:active { color:#0000FF; } .blueAnchor:hover { color:#FF00FF; cursor: pointer; cursor: hand; }Then in Java file
Anchor loadMoreAnchor=new Anchor("Load More"); loadMoreAnchor.addStyleName(getView ().getRes().css().blueAnchor ());Nothing happened to loadMoreAnchor as it still use the default Amchor css.
What is the problem? If you can fix it, can you ALSO tell me how to do to avoid duplicated css code. Look at
gwt-Anchor&blueAnchor, they are the same but have 1 different. We cold do things like:.blueAnchor:link {color:blue;} .gwt-Anchor:link {color:black;} .gwt-Anchor:visited, .blueAnchor:visited {color:#00FF00;} .gwt-Anchor:active, .blueAnchor:active { color:#0000FF; } .gwt-Anchor:hover, .blueAnchor:hover { color:#FF00FF; cursor: pointer; cursor: hand; }But I am not sure i am doing correctly.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment