I've the following style that I need to set at run-time from within GWT code:
margin: 0 0 0 -6px !important;
I've tried the following which didn't work:
Style style = htmlProductSearch.getElement().getStyle();
style.setProperty("margin", "0 0 0 -6px !important");
However, when I removed the !important
from the string, it works.. but I urgently need to make this style important.
Also I've used the setters methods setMarginxxxx
but didn't work too.
Thanks.
htmlProductSearch.getElement().setAttribute("style","margin : 0 0 0 -6px !important");
Hope this should work.
Not a perfect solution but you can use the addStyleName
to add a css style.
In this css style you can use the !important
.
This will work I think
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With