Even when stuffs worked fine, when a server level refresh happens, the change gets nullified. So I had to do the following to keep up with the task.
1. Create a Button control on the XPage
2. Code such a way that you associate a field control to its onclick event. That is when ever you click on the button, mark the field control with a flag.Let me Name the field as FlagField
3. Go to the Style tab of the button control in the properties pane.
4. click the little diamond against the style class name as illustrated in the following figure
6. Now write a style sheet with the following code,
and associate the same with the XPage.
7. This is it. Now you can preview your button and view the difference.
A sample illustration of the look feel is shown in the following figure