Delete absolute position generated by GWT

On my webpage I have a menu ( HorizontalPanel ) that should be bound to the content of the page. To do this, I tried to use the RootLayoutPanel class and add a southern widget to it, and I succeeded. but the problem is that the menu is not centered. I tried to add another CSS in which I wrote (and noticed the position):

 .cetrer { Margin-left : auto; margin-right: auto; position: relative; } 

But when the page falls asleep, the position is set to an absolute value according to GWT. And I tried to force the position by adding this character to the code, but it did not work:

 DOM.setElementAttribute(menuBar.getElement(), "style", "position: relative;"); 

So, is there any solution to fix it? Thanks

+1
source share
1 answer

You tried to add !important; ? For instance:

 .cetrer { Margin-left : auto; margin-right: auto; position: relative !important; } 

Not the best solution.

+1
source

Source: https://habr.com/ru/post/915027/


All Articles